Commit 654948e2 authored by Guido van Rossum's avatar Guido van Rossum

use settrace() intreface

parent 7416ff31
...@@ -145,8 +145,7 @@ class Bdb: # Basic Debugger ...@@ -145,8 +145,7 @@ class Bdb: # Basic Debugger
self.stopframe = self.botframe self.stopframe = self.botframe
self.returnframe = None self.returnframe = None
self.quitting = 1 self.quitting = 1
sys.trace = None sys.settrace(None)
del sys.trace
# Derived classes and clients can call the following functions # Derived classes and clients can call the following functions
# to manipulate breakpoints. These functions return an # to manipulate breakpoints. These functions return an
...@@ -245,15 +244,14 @@ class Bdb: # Basic Debugger ...@@ -245,15 +244,14 @@ class Bdb: # Basic Debugger
def runctx(self, cmd, globals, locals): def runctx(self, cmd, globals, locals):
self.reset() self.reset()
sys.trace = self.trace_dispatch sys.settrace(self.trace_dispatch)
try: try:
exec(cmd + '\n', globals, locals) exec(cmd + '\n', globals, locals)
except BdbQuit: except BdbQuit:
pass pass
finally: finally:
self.quitting = 1 self.quitting = 1
sys.trace = None sys.settrace(None)
del sys.trace
# XXX What to do if the command finishes normally? # XXX What to do if the command finishes normally?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment