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
313a7513b0
(Python 2.3), but it is not really clear.

This PR is meant to see how reverting that part goes.
This commit is contained in:
Daniel Hahler 2019-11-15 01:25:12 +01:00
parent 4d231bcc77
commit 98c5aa8aad
1 changed files with 2 additions and 2 deletions

View File

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