Is there a way to examine the last exception when in pdb/before entering pdb? (Using python 2.7.5).
Immediately (yes, I enter no other commands at all) afte
I bumped into this post, but none of the answers did what I needed, which was to repeat all of the error information (including the traceback) that was spewed before the pdb.pm()
step in the question. Here's what worked for me in the end:
Add the following lines to your .pdbrc file:
import sys
import traceback
alias rethrow traceback.print_exception(sys.last_type, sys.last_value, sys.last_traceback)
Now, next time you're in a pdb environment, you can just type rethrow
, and it will repeat all the error information from before you had typed pdb.pm()
.