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