Linecache contains support for PEP302 loaders, but fails to deal with loaders

that return None to indicate that the module is valid but no source is
available. This patch fixes that.
This commit is contained in:
Ronald Oussoren 2006-06-13 11:19:56 +00:00
parent fdbebb65af
commit 9015b938cb
1 changed files with 4 additions and 0 deletions

View File

@ -94,6 +94,10 @@ def updatecache(filename, module_globals=None):
except (ImportError, IOError):
pass
else:
if data is None:
# No luck, the PEP302 loader cannot find the source
# for this module.
return []
cache[filename] = (
len(data), None,
[line+'\n' for line in data.splitlines()], fullname