summaryrefslogtreecommitdiffstats
path: root/Lib/traceback.py
diff options
context:
space:
mode:
authorPhillip J. Eby <pje@telecommunity.com>2006-04-11 01:07:43 (GMT)
committerPhillip J. Eby <pje@telecommunity.com>2006-04-11 01:07:43 (GMT)
commit470321108019367e3bdd96309e89d79f04784d45 (patch)
tree67bb4c26a4a2e14eef1999eed390091620a850fa /Lib/traceback.py
parent7731dfdaad96c519d80823782ca4c81d09466e8d (diff)
downloadcpython-470321108019367e3bdd96309e89d79f04784d45.zip
cpython-470321108019367e3bdd96309e89d79f04784d45.tar.gz
cpython-470321108019367e3bdd96309e89d79f04784d45.tar.bz2
Updated the warnings, linecache, inspect, traceback, site, and doctest modules
to work correctly with modules imported from zipfiles or via other PEP 302 __loader__ objects. Tests and doc updates are included.
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 4047ca5..454eb1b 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -66,7 +66,7 @@ def print_tb(tb, limit=None, file=None):
_print(file,
' File "%s", line %d, in %s' % (filename,lineno,name))
linecache.checkcache(filename)
- line = linecache.getline(filename, lineno)
+ line = linecache.getline(filename, lineno, f.f_globals)
if line: _print(file, ' ' + line.strip())
tb = tb.tb_next
n = n+1
@@ -98,7 +98,7 @@ def extract_tb(tb, limit = None):
filename = co.co_filename
name = co.co_name
linecache.checkcache(filename)
- line = linecache.getline(filename, lineno)
+ line = linecache.getline(filename, lineno, f.f_globals)
if line: line = line.strip()
else: line = None
list.append((filename, lineno, name, line))
@@ -281,7 +281,7 @@ def extract_stack(f=None, limit = None):
filename = co.co_filename
name = co.co_name
linecache.checkcache(filename)
- line = linecache.getline(filename, lineno)
+ line = linecache.getline(filename, lineno, f.f_globals)
if line: line = line.strip()
else: line = None
list.append((filename, lineno, name, line))