Skip to content

Commit 561d3c1

Browse files
committed
bpo-38806: bdb: stop_here: always stop at calling frame
The following will not stop for debugging: python3.8 -c 'import pdb; pdb.Pdb(skip=["*"]).set_trace()' The example is contrived, the real case would be to have some "noisy" module being excluded in general, but when you add an explicit "set_trace()" in there it should still stop there, and not on some upper frame. This was changed a long time already in 313a751 (Python 2.3), but it is not really clear. This PR is meant to see how reverting that part goes.
1 parent 94b4626 commit 561d3c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/bdb.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ def is_skipped_module(self, module_name):
201201

202202
def stop_here(self, frame):
203203
"Return True if frame is below the starting frame in the stack."
204-
# (CT) stopframe may now also be None, see dispatch_call.
205-
# (CT) the former test for None is therefore removed from here.
204+
if self.stopframe is None:
205+
return True
206206
if self.skip and \
207207
self.is_skipped_module(frame.f_globals.get('__name__')):
208208
return False

0 commit comments

Comments
 (0)