mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
use settrace() intreface
This commit is contained in:
parent
35dcf454e1
commit
edbfcbd7ef
1 changed files with 3 additions and 5 deletions
|
|
@ -145,8 +145,7 @@ def set_quit(self):
|
|||
self.stopframe = self.botframe
|
||||
self.returnframe = None
|
||||
self.quitting = 1
|
||||
sys.trace = None
|
||||
del sys.trace
|
||||
sys.settrace(None)
|
||||
|
||||
# Derived classes and clients can call the following functions
|
||||
# to manipulate breakpoints. These functions return an
|
||||
|
|
@ -245,15 +244,14 @@ def run(self, cmd):
|
|||
|
||||
def runctx(self, cmd, globals, locals):
|
||||
self.reset()
|
||||
sys.trace = self.trace_dispatch
|
||||
sys.settrace(self.trace_dispatch)
|
||||
try:
|
||||
exec(cmd + '\n', globals, locals)
|
||||
except BdbQuit:
|
||||
pass
|
||||
finally:
|
||||
self.quitting = 1
|
||||
sys.trace = None
|
||||
del sys.trace
|
||||
sys.settrace(None)
|
||||
# XXX What to do if the command finishes normally?
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue