MCPcopy Index your code
hub / github.com/RustPython/RustPython / do_condition

Method do_condition

Lib/pdb.py:813–836  ·  view source on GitHub ↗

condition bpnumber [condition] Set a new condition for the breakpoint, an expression which must evaluate to true before the breakpoint is honored. If condition is absent, any existing condition is removed; i.e., the breakpoint is made unconditional.

(self, arg)

Source from the content-addressed store, hash-verified

811 complete_disable = _complete_bpnumber
812
813 def do_condition(self, arg):
814 """condition bpnumber [condition]
815 Set a new condition for the breakpoint, an expression which
816 must evaluate to true before the breakpoint is honored. If
817 condition is absent, any existing condition is removed; i.e.,
818 the breakpoint is made unconditional.
819 """
820 args = arg.split(' ', 1)
821 try:
822 cond = args[1]
823 except IndexError:
824 cond = None
825 try:
826 bp = self.get_bpbynumber(args[0].strip())
827 except IndexError:
828 self.error('Breakpoint number expected')
829 except ValueError as err:
830 self.error(err)
831 else:
832 bp.cond = cond
833 if not cond:
834 self.message('Breakpoint %d is now unconditional.' % bp.number)
835 else:
836 self.message('New condition set for breakpoint %d.' % bp.number)
837
838 complete_condition = _complete_bpnumber
839

Callers

nothing calls this directly

Calls 5

errorMethod · 0.95
messageMethod · 0.95
get_bpbynumberMethod · 0.80
splitMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected