File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -485,7 +485,11 @@ def do_condition(self, arg):
485485 cond = args [1 ]
486486 except :
487487 cond = None
488- bp = bdb .Breakpoint .bpbynumber [bpnum ]
488+ try :
489+ bp = bdb .Breakpoint .bpbynumber [bpnum ]
490+ except IndexError :
491+ print >> self .stdout , 'Breakpoint index %r is not valid' % args [0 ]
492+ return
489493 if bp :
490494 bp .cond = cond
491495 if not cond :
@@ -506,7 +510,11 @@ def do_ignore(self,arg):
506510 count = int (args [1 ].strip ())
507511 except :
508512 count = 0
509- bp = bdb .Breakpoint .bpbynumber [bpnum ]
513+ try :
514+ bp = bdb .Breakpoint .bpbynumber [bpnum ]
515+ except IndexError :
516+ print >> self .stdout , 'Breakpoint index %r is not valid' % args [0 ]
517+ return
510518 if bp :
511519 bp .ignore = count
512520 if count > 0 :
Original file line number Diff line number Diff line change @@ -158,6 +158,9 @@ Core and builtins
158158Library
159159-------
160160
161+ - Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap
162+ the IndexError caused by passing in an invalid breakpoint number.
163+
161164- Patch #1599845: Add an option to disable the implicit calls to server_bind()
162165 and server_activate() in the constructors for TCPServer, SimpleXMLRPCServer
163166 and DocXMLRPCServer.
You can’t perform that action at this time.
0 commit comments