Starting python debugger automatically on error

Posted by jeremy on Stack Overflow See other posts from Stack Overflow or by jeremy
Published on 2008-10-28T07:37:15Z Indexed on 2010/03/13 15:25 UTC
Read the original article Hit count: 240

Filed under:
|

This is a question I have wondered about for quite some time, yet I have never found a suitable solution. If I run a script and I come across, let's say an IndexError, python prints the line, location and quick description of the error and exits. Is it possible to automatically start pdb when an error is encountered? I am not against having an extra import statement at the top of the file, nor a few extra lines of code.

© Stack Overflow or respective owner

Related posts about python

Related posts about debugging