Commit d612e1ba authored by Arnaud Fontaine's avatar Arnaud Fontaine

linecache: Traceback could not be displayed if module_globals is None.

parent 2ac367df
...@@ -144,11 +144,11 @@ def patch_linecache(): ...@@ -144,11 +144,11 @@ def patch_linecache():
# Get source code of ZODB Components following PEP 302 # Get source code of ZODB Components following PEP 302
if (filename.startswith('<portal_components/') and if (filename.startswith('<portal_components/') and
'__loader__' in module_globals): module_globals is not None):
data = None data = None
name = module_globals.get('__name__') name = module_globals.get('__name__')
loader = module_globals['__loader__'] get_source = getattr(module_globals.get('__loader__'),
get_source = getattr(loader, 'get_source', None) 'get_source', None)
if name and get_source: if name and get_source:
try: try:
data = get_source(name) data = get_source(name)
......
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