Skip to content

Commit

Permalink
Fix post-mortem debugging for Py3
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Dec 28, 2021
1 parent 6aa87ab commit f77332c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pudb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,17 @@ def post_mortem(tb=None, e_type=None, e_value=None):

dbg = _get_debugger()
dbg.reset()
dbg.interaction(tb.tb_frame, exc_info)
dbg.interaction(None, (exc_info[0], exc_info[1], tb))


def pm():
import sys
try:
e_type = sys.last_type
e_value = sys.last_value
tb = sys.last_traceback
except AttributeError:
exc_type, exc_val, tb = sys.exc_info()

if exc_type is None:
# No exception on record. Do nothing.
return
post_mortem(tb, e_type, e_value)
post_mortem()


if __name__ == "__main__":
Expand Down

0 comments on commit f77332c

Please sign in to comment.