diff --git a/Lib/pdb.py b/Lib/pdb.py index 7b5dffa3b64..b00f68b79d5 100755 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -450,11 +450,14 @@ def do_clear(self, arg): return numberlist = arg.split() for i in numberlist: + if not (0 <= i < len(bdb.Breakpoint.bpbynumber)): + print 'No breakpoint numbered', i + continue err = self.clear_bpbynumber(i) if err: print '***', err else: - print 'Deleted breakpoint %s ' % (i,) + print 'Deleted breakpoint', i do_cl = do_clear # 'c' is already an abbreviation for 'continue' def do_where(self, arg): diff --git a/Misc/NEWS b/Misc/NEWS index b59c7dd7762..b88608e58d2 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -191,6 +191,8 @@ Extension Modules Library ------- +- Bug #1192315: Disallow negative arguments to clear() in pdb. + - Patch #827386: Support absolute source paths in msvccompiler.py. - Patch #1105730: Apply the new implementation of commonprefix in posixpath