diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-05-01 17:19:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-01 17:19:47 (GMT) |
commit | a679c3d58d10aafd9ac9355fdd16151607e37d65 (patch) | |
tree | f02589aec2f9f81c5bc2c2f744d1c71f8e1493e7 /Lib/traceback.py | |
parent | 2a884ceb36e799c900129d4b5b6248262004efb5 (diff) | |
download | cpython-a679c3d58d10aafd9ac9355fdd16151607e37d65.zip cpython-a679c3d58d10aafd9ac9355fdd16151607e37d65.tar.gz cpython-a679c3d58d10aafd9ac9355fdd16151607e37d65.tar.bz2 |
gh-102799: replace sys.exc_info by sys.exception in inspect and traceback modules (#104032)
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index ba4a9ff..419f6e8 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -179,12 +179,12 @@ def _safe_string(value, what, func=str): # -- def print_exc(limit=None, file=None, chain=True): - """Shorthand for 'print_exception(*sys.exc_info(), limit, file, chain)'.""" - print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain) + """Shorthand for 'print_exception(sys.exception(), limit, file, chain)'.""" + print_exception(sys.exception(), limit=limit, file=file, chain=chain) def format_exc(limit=None, chain=True): """Like print_exc() but return a string.""" - return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain)) + return "".join(format_exception(sys.exception(), limit=limit, chain=chain)) def print_last(limit=None, file=None, chain=True): """This is a shorthand for 'print_exception(sys.last_exc, limit, file, chain)'.""" |