mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
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.
This commit is contained in:
parent
7b3c8a1422
commit
3577113d83
6 changed files with 63 additions and 4 deletions
18
Lib/pdb.py
18
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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue