Python Forum

Full Version: How to recover from exception in pdb?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
Not sure, but perhaps:
pdb.post_mortem([i]traceback=None[/i])