mirror of https://github.com/python/cpython
fix very old names for exception terms #5543
This commit is contained in:
parent
1fba62427c
commit
85e1478ca4
|
@ -149,7 +149,7 @@ def format_exception_only(etype, value):
|
||||||
"""Format the exception part of a traceback.
|
"""Format the exception part of a traceback.
|
||||||
|
|
||||||
The arguments are the exception type and value such as given by
|
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.
|
strings, each ending in a newline.
|
||||||
|
|
||||||
Normally, the list contains a single string; however, for
|
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):
|
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:
|
if file is None:
|
||||||
file = sys.stderr
|
file = sys.stderr
|
||||||
print_exception(sys.last_type, sys.last_value, sys.last_traceback,
|
print_exception(*(sys.exc_info() + (limit, file)))
|
||||||
limit, file)
|
|
||||||
|
|
||||||
|
|
||||||
def print_stack(f=None, limit=None, file=None):
|
def print_stack(f=None, limit=None, file=None):
|
||||||
|
|
Loading…
Reference in New Issue