[Python-checkins] r45892 - python/branches/release24-maint/Lib/pdb.py
georg.brandl
python-checkins at python.org
Wed May 3 20:12:37 CEST 2006
Author: georg.brandl
Date: Wed May 3 20:12:36 2006
New Revision: 45892
Modified:
python/branches/release24-maint/Lib/pdb.py
Log:
Bug #1472191: convert breakpoint indices to ints before comparing them to ints
(backport from rev. 45891)
Modified: python/branches/release24-maint/Lib/pdb.py
==============================================================================
--- python/branches/release24-maint/Lib/pdb.py (original)
+++ python/branches/release24-maint/Lib/pdb.py Wed May 3 20:12:36 2006
@@ -442,7 +442,7 @@
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 @@
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
More information about the Python-checkins
mailing list