]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Bug #1472191: convert breakpoint indices to ints before comparing them to ints
authorGeorg Brandl <georg@python.org>
Wed, 3 May 2006 18:12:36 +0000 (18:12 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 3 May 2006 18:12:36 +0000 (18:12 +0000)
 (backport from rev. 45891)

Lib/pdb.py

index b00f68b79d50f7f20305b13565fabc31e1191ed9..daddb9c7f820b041fe24f2989bb9785a643f7a8e 100755 (executable)
@@ -442,7 +442,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
             arg = arg[i+1:]
             try:
                 lineno = int(arg)
-            except:
+            except ValueError:
                 err = "Invalid line number (%s)" % arg
             else:
                 err = self.clear_break(filename, lineno)
@@ -450,6 +450,12 @@ class Pdb(bdb.Bdb, cmd.Cmd):
             return
         numberlist = arg.split()
         for i in numberlist:
+            try:
+                i = int(i)
+            except ValueError:
+                print 'Breakpoint index %r is not a number' % i
+                continue
+
             if not (0 <= i < len(bdb.Breakpoint.bpbynumber)):
                 print 'No breakpoint numbered', i
                 continue