diff options
author | Guido van Rossum <guido@python.org> | 1992-09-08 11:59:04 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-09-08 11:59:04 (GMT) |
commit | 3577113d8366d1c75cf2cbdbeb5168fd86d2834c (patch) | |
tree | 1522d69f53f331f7e9ecf11b820baf7fdb67fb46 /Lib/stdwin | |
parent | 7b3c8a1422be4e2d7bc5e59779071432ef57c1cb (diff) | |
download | cpython-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/stdwin')
-rwxr-xr-x | Lib/stdwin/wdb.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Lib/stdwin/wdb.py b/Lib/stdwin/wdb.py index b3d6b73..c499296 100755 --- a/Lib/stdwin/wdb.py +++ b/Lib/stdwin/wdb.py @@ -2,8 +2,6 @@ # XXX To do: # - don't fall out of bottom frame -# - is the /tmp file hack really needed? -# - also use it for post-mortem debugging import stdwin @@ -273,6 +271,8 @@ class Wdb(bdb.Bdb, basewin.BaseWindow): # Window debugger d.close() +# Simplified interface + def run(statement): x = Wdb().init() try: x.run(statement) @@ -288,6 +288,21 @@ def runcall(*args): try: apply(Pdb().init().runcall, args) finally: x.close() + +# Post-Mortem interface + +def post_mortem(traceback): + p = Pdb().init() + p.reset() + p.interaction(None, traceback) + +def pm(): + import sys + post_mortem(sys.last_traceback) + + +# Main program for testing + TESTCMD = 'import x; x.main()' def test(): |