diff options
author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2009-04-07 14:33:53 (GMT) |
---|---|---|
committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2009-04-07 14:33:53 (GMT) |
commit | 32b18cc2cfd0a54611192e500757952bd9fcf0d4 (patch) | |
tree | d651346fea180d1dd8bbc58e9c389abc5458236d /Lib/traceback.py | |
parent | cfbb18f149d549a06c3cac5e48eb66e1457615a6 (diff) | |
download | cpython-32b18cc2cfd0a54611192e500757952bd9fcf0d4.zip cpython-32b18cc2cfd0a54611192e500757952bd9fcf0d4.tar.gz cpython-32b18cc2cfd0a54611192e500757952bd9fcf0d4.tar.bz2 |
Rolled back revisions 71237 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index ea3d51a..3d877ee 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -64,7 +64,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()) @@ -124,8 +124,9 @@ def print_exception(etype, value, tb, limit=None, file=None): _print(file, 'Traceback (most recent call last):') print_tb(tb, limit, file) lines = format_exception_only(etype, value) - for line in lines: - _print(file, line, '') + for line in lines[:-1]: + _print(file, line, ' ') + _print(file, lines[-1], '') def format_exception(etype, value, tb, limit = None): """Format a stack trace and the exception information. @@ -194,7 +195,7 @@ def format_exception_only(etype, value): caretspace = ((c.isspace() and c or ' ') for c in caretspace) # only three spaces to account for offset1 == pos 0 lines.append(' %s^\n' % ''.join(caretspace)) - value = msg + value = msg lines.append(_format_final_exc_line(stype, value)) return lines |