diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-03-23 20:47:59 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-03-23 20:47:59 (GMT) |
commit | 85e1478ca412f93e584046b44633283f6241df84 (patch) | |
tree | 3325fa472a3f65e4aa2941f558e8cca0d236cb0b /Lib/traceback.py | |
parent | 1fba62427cdf51788125386aa3d603c6ae74e7e3 (diff) | |
download | cpython-85e1478ca412f93e584046b44633283f6241df84.zip cpython-85e1478ca412f93e584046b44633283f6241df84.tar.gz cpython-85e1478ca412f93e584046b44633283f6241df84.tar.bz2 |
fix very old names for exception terms #5543
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index 3d877ee..381fb1f 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -149,7 +149,7 @@ def format_exception_only(etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by - sys.last_type and sys.last_value. The return value is a list of + sys.exc_info()[0] and sys.exc_info()[1]. The return value is a list of strings, each ending in a newline. Normally, the list contains a single string; however, for @@ -239,12 +239,12 @@ def format_exc(limit=None): def print_last(limit=None, file=None): - """This is a shorthand for 'print_exception(sys.last_type, - sys.last_value, sys.last_traceback, limit, file)'.""" + """ + This is a shorthand for 'print_exception(*sys.exc_info(), limit, file)'. + """ if file is None: file = sys.stderr - print_exception(sys.last_type, sys.last_value, sys.last_traceback, - limit, file) + print_exception(*(sys.exc_info() + (limit, file))) def print_stack(f=None, limit=None, file=None): |