summaryrefslogtreecommitdiff
path: root/Lib/linecache.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2006-06-13 11:19:56 +0000
committerRonald Oussoren <ronaldoussoren@mac.com>2006-06-13 11:19:56 +0000
commit9015b938cb2232c233a925e580b6a42f0066d08c (patch)
tree4498b70d5f84f35551a71a07a799e9f49c17910f /Lib/linecache.py
parentfdbebb65af31809d346592f8dbb3883ca0b7c235 (diff)
downloadcpython-git-9015b938cb2232c233a925e580b6a42f0066d08c.tar.gz
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.
Diffstat (limited to 'Lib/linecache.py')
-rw-r--r--Lib/linecache.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/linecache.py b/Lib/linecache.py
index f49695ac1c..4838625f08 100644
--- a/Lib/linecache.py
+++ b/Lib/linecache.py
@@ -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