Kaydet (Commit) 9015b938 authored tarafından Ronald Oussoren's avatar Ronald Oussoren

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.
üst fdbebb65
...@@ -94,6 +94,10 @@ def updatecache(filename, module_globals=None): ...@@ -94,6 +94,10 @@ def updatecache(filename, module_globals=None):
except (ImportError, IOError): except (ImportError, IOError):
pass pass
else: else:
if data is None:
# No luck, the PEP302 loader cannot find the source
# for this module.
return []
cache[filename] = ( cache[filename] = (
len(data), None, len(data), None,
[line+'\n' for line in data.splitlines()], fullname [line+'\n' for line in data.splitlines()], fullname
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment