diff options
author | Georg Brandl <georg@python.org> | 2009-04-05 14:28:42 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-04-05 14:28:42 +0000 |
commit | 236f7979ba99430710bc249446a343195e252010 (patch) | |
tree | e8a64807b3805cdf586a7793c78660b18ac0f78d /Lib/traceback.py | |
parent | dfd734429ec24b6d55b11f48afe4a9bc8f3db730 (diff) | |
download | cpython-git-236f7979ba99430710bc249446a343195e252010.tar.gz |
Merged revisions 71237-71238 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71237 | georg.brandl | 2009-04-05 16:24:52 +0200 (So, 05 Apr 2009) | 1 line
#1326077: fix traceback formatting of SyntaxErrors. This fixes two differences with formatting coming from Python: a) the reproduction of location details in the error message if no line text is given, b) the prefixing of the last line by one space.
........
r71238 | georg.brandl | 2009-04-05 16:25:41 +0200 (So, 05 Apr 2009) | 1 line
Add NEWS entry for r71237.
........
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index cb913eebae..571ff57649 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -63,7 +63,7 @@ def print_tb(tb, limit=None, file=None): filename = co.co_filename name = co.co_name _print(file, - ' File "%s", line %d, in %s' % (filename,lineno,name)) + ' File "%s", line %d, in %s' % (filename, lineno, name)) linecache.checkcache(filename) line = linecache.getline(filename, lineno, f.f_globals) if line: _print(file, ' ' + line.strip()) @@ -159,9 +159,8 @@ def print_exception(etype, value, tb, limit=None, file=None, chain=True): _print(file, 'Traceback (most recent call last):') print_tb(tb, limit, file) lines = format_exception_only(type(value), value) - for line in lines[:-1]: - _print(file, line, ' ') - _print(file, lines[-1], '') + for line in lines: + _print(file, line, '') def format_exception(etype, value, tb, limit=None, chain=True): """Format a stack trace and the exception information. |