MCPcopy Index your code
hub / github.com/python/cpython / break_here

Method break_here

Lib/bdb.py:446–471  ·  view source on GitHub ↗

Return True if there is an effective breakpoint for this line. Check for line or function breakpoint and if in effect. Delete temporary breakpoints if effective() says to.

(self, frame)

Source from the content-addressed store, hash-verified

444 return False
445
446 def break_here(self, frame):
447 """Return True if there is an effective breakpoint for this line.
448
449 Check for line or function breakpoint and if in effect.
450 Delete temporary breakpoints if effective() says to.
451 """
452 filename = self.canonic(frame.f_code.co_filename)
453 if filename not in self.breaks:
454 return False
455 lineno = frame.f_lineno
456 if lineno not in self.breaks[filename]:
457 # The line itself has no breakpoint, but maybe the line is the
458 # first line of a function with breakpoint set by function name.
459 lineno = frame.f_code.co_firstlineno
460 if lineno not in self.breaks[filename]:
461 return False
462
463 # flag says ok to delete temp. bp
464 (bp, flag) = effective(filename, lineno, frame)
465 if bp:
466 self.currentbp = bp.number
467 if (flag and bp.temporary):
468 self.do_clear(str(bp.number))
469 return True
470 else:
471 return False
472
473 def do_clear(self, arg):
474 """Remove temporary breakpoint.

Callers 1

dispatch_lineMethod · 0.95

Calls 4

canonicMethod · 0.95
do_clearMethod · 0.95
effectiveFunction · 0.85
strFunction · 0.85

Tested by

no test coverage detected