summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-05-03 18:12:33 (GMT)
committerGeorg Brandl <georg@python.org>2006-05-03 18:12:33 (GMT)
commit23d9d45482fc3ed67c26418d20f31bfb201db4dd (patch)
tree94644cea3b7d18aa5bd9231bab649b54b5d8eaaf /Lib/pdb.py
parenta2ac2ef44f67006edc694ef8281cb42b5cfddc7b (diff)
downloadcpython-23d9d45482fc3ed67c26418d20f31bfb201db4dd.zip
cpython-23d9d45482fc3ed67c26418d20f31bfb201db4dd.tar.gz
cpython-23d9d45482fc3ed67c26418d20f31bfb201db4dd.tar.bz2
Bug #1472191: convert breakpoint indices to ints before comparing them to ints
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index c501a38..adc7111 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -527,7 +527,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)
@@ -535,6 +535,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