]> granicus.if.org Git - python/commitdiff
bug [ 1192315 ] 'clear -1' in pdb
authorGeorg Brandl <georg@python.org>
Wed, 24 Aug 2005 07:36:17 +0000 (07:36 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 24 Aug 2005 07:36:17 +0000 (07:36 +0000)
Lib/pdb.py
Misc/NEWS

index 7b5dffa3b6479126736f6277ae79d95ed32bede6..b00f68b79d50f7f20305b13565fabc31e1191ed9 100755 (executable)
@@ -450,11 +450,14 @@ class Pdb(bdb.Bdb, cmd.Cmd):
             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):
index b59c7dd7762d963c917e7493690e80cd87e6bcf2..b88608e58d2d070004d1c2a7250a71e6071f72c5 100644 (file)
--- 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