Skip to content

Instantly share code, notes, and snippets.

@acdha
Created May 6, 2011 18:07
Show Gist options
  • Save acdha/959461 to your computer and use it in GitHub Desktop.
Save acdha/959461 to your computer and use it in GitHub Desktop.
Run ipdb/pdb on the last exception
import sys
tb = sys.exc_info()[2]
try:
import ipdb as pdb
except ImportError:
import pdb
sys.last_traceback = tb
pdb.pm()
raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment