summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-09-08 11:59:04 (GMT)
committerGuido van Rossum <guido@python.org>1992-09-08 11:59:04 (GMT)
commit3577113d8366d1c75cf2cbdbeb5168fd86d2834c (patch)
tree1522d69f53f331f7e9ecf11b820baf7fdb67fb46 /Lib/pdb.py
parent7b3c8a1422be4e2d7bc5e59779071432ef57c1cb (diff)
downloadcpython-3577113d8366d1c75cf2cbdbeb5168fd86d2834c.zip
cpython-3577113d8366d1c75cf2cbdbeb5168fd86d2834c.tar.gz
cpython-3577113d8366d1c75cf2cbdbeb5168fd86d2834c.tar.bz2
Added post_mortem() and pm() interfaces to pdb and wdb.
Added colorsys.py (color system conversions). SV.py: new version for new svideo.h (Sjoerd). DEVICE.py: added VIDEO event type.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index f564f64..94dcd79 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -248,6 +248,8 @@ class Pdb(bdb.Bdb, cmd.Cmd):
print self.format_stack_entry(frame_lineno)
+# Simplified interface
+
def run(statement):
Pdb().init().run(statement)
@@ -257,6 +259,22 @@ def runctx(statement, globals, locals):
def runcall(*args):
apply(Pdb().init().runcall, args)
+
+# Post-Mortem interface
+
+def post_mortem(t):
+ p = Pdb().init()
+ p.reset()
+ while t.tb_next <> None: t = t.tb_next
+ p.interaction(t.tb_frame, t)
+
+def pm():
+ import sys
+ post_mortem(sys.last_traceback)
+
+
+# Main program for testing
+
TESTCMD = 'import x; x.main()'
def test():