[Python-checkins] r46855 - in python/trunk/Lib: pkgutil.py wsgiref/validate.py

neal.norwitz python-checkins at python.org
Sun Jun 11 09:26:28 CEST 2006


Author: neal.norwitz
Date: Sun Jun 11 09:26:27 2006
New Revision: 46855

Modified:
   python/trunk/Lib/pkgutil.py
   python/trunk/Lib/wsgiref/validate.py
Log:
Fix errors found by pychecker

Modified: python/trunk/Lib/pkgutil.py
==============================================================================
--- python/trunk/Lib/pkgutil.py	(original)
+++ python/trunk/Lib/pkgutil.py	Sun Jun 11 09:26:27 2006
@@ -208,6 +208,7 @@
 
     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):

Modified: python/trunk/Lib/wsgiref/validate.py
==============================================================================
--- python/trunk/Lib/wsgiref/validate.py	(original)
+++ python/trunk/Lib/wsgiref/validate.py	Sun Jun 11 09:26:27 2006
@@ -248,7 +248,7 @@
 
     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 @@
             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'])


More information about the Python-checkins mailing list