mirror of https://github.com/python/cpython
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:
parent
fdbebb65af
commit
9015b938cb
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue