mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_value,sys.last_traceback (#102779)
This commit is contained in:
parent
039714d00f
commit
e1e9bab006
22 changed files with 103 additions and 36 deletions
|
@ -1739,7 +1739,11 @@ def post_mortem(t=None):
|
|||
|
||||
def pm():
|
||||
"""Enter post-mortem debugging of the traceback found in sys.last_traceback."""
|
||||
post_mortem(sys.last_traceback)
|
||||
if hasattr(sys, 'last_exc'):
|
||||
tb = sys.last_exc.__traceback__
|
||||
else:
|
||||
tb = sys.last_traceback
|
||||
post_mortem(tb)
|
||||
|
||||
|
||||
# Main program for testing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue