Python Forum
How to recover from exception in pdb?
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to recover from exception in pdb?
#1
When stepping through the code in pdb and a line is ran that triggers an error, is there a way to fix the error without exiting the execution of the script?

I know it's possible to type !command and test the execution of commands prior to typing n for next in the debugger. However, if I do cross a command that throws an exception, is there a way to j jump back (doesn't seem to work) or otherwise avoid restarting the program.

The overhead of restarting the program is the whole reason I use a debugger instead of exclusively print statements in the first place.

Thanks! :D
Reply
#2
Not sure, but perhaps:
pdb.post_mortem([i]traceback=None[/i])
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  During handling of the above exception, another exception occurred Skaperen 7 26,728 Dec-21-2018, 10:58 AM
Last Post: Gribouillis
  Simple Dictionary save and recover Astrikor 12 5,856 Aug-22-2018, 06:51 AM
Last Post: Astrikor
  Recover currently running script? kbriden 3 4,428 Dec-07-2016, 01:53 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020