We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1732f4b + 846ea9c commit e1a355eCopy full SHA for e1a355e
bpdb/__init__.py
@@ -34,3 +34,22 @@ def set_trace():
34
a debugger instance and sets the trace. """
35
debugger = BPdb()
36
debugger.set_trace(sys._getframe().f_back)
37
+
38
+# Adopted verbatim from pdb for completeness:
39
40
+def post_mortem(t=None):
41
+ # handling the default
42
+ if t is None:
43
+ # sys.exc_info() returns (type, value, traceback) if an exception is
44
+ # being handled, otherwise it returns None
45
+ t = sys.exc_info()[2]
46
47
+ raise ValueError("A valid traceback must be passed if no "
48
+ "exception is being handled")
49
50
+ p = BPdb()
51
+ p.reset()
52
+ p.interaction(None, t)
53
54
+def pm():
55
+ post_mortem(getattr(sys, "last_traceback", None))
0 commit comments