Kaydet (Commit) 84a6c205 authored tarafından Johannes Gijsbers's avatar Johannes Gijsbers

Bug #1055168: calling pdb.set_trace() calls Bdb.set_trace, which made

the debugger enter inside pdb.set_trace.

Patch #1061767: make pdb.set_trace enter enter at the stack frame
calling pdb.set_trace().
üst e174ae9a
...@@ -178,9 +178,13 @@ class Bdb: ...@@ -178,9 +178,13 @@ class Bdb:
self.returnframe = frame self.returnframe = frame
self.quitting = 0 self.quitting = 0
def set_trace(self): def set_trace(self, frame=None):
"""Start debugging from here.""" """Start debugging from `frame`.
frame = sys._getframe().f_back
If frame is not specified, debugging starts from caller's frame.
"""
if frame is None:
frame = sys._getframe().f_back
self.reset() self.reset()
while frame: while frame:
frame.f_trace = self.trace_dispatch frame.f_trace = self.trace_dispatch
......
...@@ -997,7 +997,7 @@ def runcall(*args, **kwds): ...@@ -997,7 +997,7 @@ def runcall(*args, **kwds):
return Pdb().runcall(*args, **kwds) return Pdb().runcall(*args, **kwds)
def set_trace(): def set_trace():
Pdb().set_trace() Pdb().set_trace(sys._getframe().f_back)
# Post-Mortem interface # Post-Mortem interface
......
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