]> granicus.if.org Git - python/commitdiff
Fix errors found by pychecker
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 11 Jun 2006 07:26:27 +0000 (07:26 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 11 Jun 2006 07:26:27 +0000 (07:26 +0000)
Lib/pkgutil.py
Lib/wsgiref/validate.py

index 26c797f0f6775611c37a6559de6a26513c997bdf..1683fae379a978b34cf249df8c92a92226e50491 100644 (file)
@@ -208,6 +208,7 @@ class ImpLoader:
 
     def _reopen(self):
         if self.file and self.file.closed:
+            mod_type = self.etc[2]
             if mod_type==imp.PY_SOURCE:
                 self.file = open(self.filename, 'rU')
             elif mod_type in (imp.PY_COMPILED, imp.C_EXTENSION):
index 934822b30fb86e5a9715e400fc052ddb44b6e68d..f7b1ae78429a620e55e8023a5766d81ed920afb4 100644 (file)
@@ -248,7 +248,7 @@ class PartialIteratorWrapper:
 
     def __iter__(self):
         # We want to make sure __iter__ is called
-        return IteratorWrapper(self.iterator)
+        return IteratorWrapper(self.iterator, None)
 
 class IteratorWrapper:
 
@@ -313,7 +313,7 @@ def check_environ(environ):
             continue
         assert type(environ[key]) is StringType, (
             "Environmental variable %s is not a string: %r (value: %r)"
-            % (type(environ[key]), environ[key]))
+            % (key, type(environ[key]), environ[key]))
 
     assert type(environ['wsgi.version']) is TupleType, (
         "wsgi.version should be a tuple (%r)" % environ['wsgi.version'])