Skip to content

Instantly share code, notes, and snippets.

@dwf
Created July 9, 2010 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwf/468955 to your computer and use it in GitHub Desktop.
Save dwf/468955 to your computer and use it in GitHub Desktop.
Quick hack to get pudb to respond to the %debug magic in IPython 0.10.
--- iplib.bak 2010-07-08 22:30:10.000000000 -0400
+++ iplib.py 2010-07-08 22:31:09.000000000 -0400
@@ -1684,6 +1684,14 @@
if Debugger.has_pydb:
from pydb import pm
else:
+ try:
+ import pudb
+ pudb.post_mortem((sys.last_type,
+ sys.last_value,
+ sys.last_traceback))
+ return
+ except ImportError:
+ pass
# fallback to our internal debugger
pm = lambda : self.InteractiveTB.debugger(force=True)
self.history_saving_wrapper(pm)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment