At the online prompt, type
>>> import pdb >>> pdb.pm()
pdb.pm () - post-mortem debugger. It will put you in the area where the exception was thrown, and then you can use the usual pdb commands.
I use it all the time. This is part of the standard library (ipython is not necessary) and does not require editing debug commands in the source code.
The only trick - do not forget to do it right away; if you enter any other commands, you will lose the area in which the exception occurred.
source share