Fix errors found by pychecker
This commit is contained in:
parent
7d5b6e8991
commit
f992a2b11e
|
@ -208,6 +208,7 @@ class ImpLoader:
|
||||||
|
|
||||||
def _reopen(self):
|
def _reopen(self):
|
||||||
if self.file and self.file.closed:
|
if self.file and self.file.closed:
|
||||||
|
mod_type = self.etc[2]
|
||||||
if mod_type==imp.PY_SOURCE:
|
if mod_type==imp.PY_SOURCE:
|
||||||
self.file = open(self.filename, 'rU')
|
self.file = open(self.filename, 'rU')
|
||||||
elif mod_type in (imp.PY_COMPILED, imp.C_EXTENSION):
|
elif mod_type in (imp.PY_COMPILED, imp.C_EXTENSION):
|
||||||
|
|
|
@ -248,7 +248,7 @@ class PartialIteratorWrapper:
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
# We want to make sure __iter__ is called
|
# We want to make sure __iter__ is called
|
||||||
return IteratorWrapper(self.iterator)
|
return IteratorWrapper(self.iterator, None)
|
||||||
|
|
||||||
class IteratorWrapper:
|
class IteratorWrapper:
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ def check_environ(environ):
|
||||||
continue
|
continue
|
||||||
assert type(environ[key]) is StringType, (
|
assert type(environ[key]) is StringType, (
|
||||||
"Environmental variable %s is not a string: %r (value: %r)"
|
"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, (
|
assert type(environ['wsgi.version']) is TupleType, (
|
||||||
"wsgi.version should be a tuple (%r)" % environ['wsgi.version'])
|
"wsgi.version should be a tuple (%r)" % environ['wsgi.version'])
|
||||||
|
|
Loading…
Reference in New Issue