diff options
author | Guido van Rossum <guido@python.org> | 1998-03-26 22:14:20 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-03-26 22:14:20 (GMT) |
commit | 548703a1b81f6adf68a3dd4b497a88f5c4a31f4a (patch) | |
tree | 8fc46e5faa2a7e82e6748995c555d7fe0b781449 /Lib/dos-8x3/tracebac.py | |
parent | 65e5399081e23d7b1efbf685096c65d0a0ab912b (diff) | |
download | cpython-548703a1b81f6adf68a3dd4b497a88f5c4a31f4a.zip cpython-548703a1b81f6adf68a3dd4b497a88f5c4a31f4a.tar.gz cpython-548703a1b81f6adf68a3dd4b497a88f5c4a31f4a.tar.bz2 |
The usual.
Diffstat (limited to 'Lib/dos-8x3/tracebac.py')
-rwxr-xr-x | Lib/dos-8x3/tracebac.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/dos-8x3/tracebac.py b/Lib/dos-8x3/tracebac.py index d508e03..70d3230 100755 --- a/Lib/dos-8x3/tracebac.py +++ b/Lib/dos-8x3/tracebac.py @@ -87,6 +87,8 @@ def format_exception(etype, value, tb, limit = None): if tb: list = ['Traceback (innermost last):\n'] list = list + format_tb(tb, limit) + else: + list = [] list = list + format_exception_only(etype, value) return list @@ -186,9 +188,13 @@ def extract_stack(f=None, limit = None): # with -O on). # Coded by Marc-Andre Lemburg from the example of PyCode_Addr2Line() # in compile.c. +# Revised version by Jim Hugunin to work with JPython too. def tb_lineno(tb): c = tb.tb_frame.f_code + if not hasattr(c, 'co_lnotab'): + return tb.tb_lineno + tab = c.co_lnotab line = c.co_firstlineno stopat = tb.tb_lasti |