mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Bug #1472191: convert breakpoint indices to ints before comparing them to ints
This commit is contained in:
parent
a2ac2ef44f
commit
23d9d45482
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue