Commit e498083b authored by Georg Brandl's avatar Georg Brandl

Bug #1627316: handle error in condition/ignore pdb commands more gracefully.

parent 62634952
...@@ -474,7 +474,12 @@ class Pdb(bdb.Bdb, cmd.Cmd): ...@@ -474,7 +474,12 @@ class Pdb(bdb.Bdb, cmd.Cmd):
def do_condition(self, arg): def do_condition(self, arg):
# arg is breakpoint number and condition # arg is breakpoint number and condition
args = arg.split(' ', 1) args = arg.split(' ', 1)
bpnum = int(args[0].strip()) try:
bpnum = int(args[0].strip())
except ValueError:
# something went wrong
print >>self.stdout, \
'Breakpoint index %r is not a number' % args[0]
try: try:
cond = args[1] cond = args[1]
except: except:
...@@ -489,7 +494,12 @@ class Pdb(bdb.Bdb, cmd.Cmd): ...@@ -489,7 +494,12 @@ class Pdb(bdb.Bdb, cmd.Cmd):
def do_ignore(self,arg): def do_ignore(self,arg):
"""arg is bp number followed by ignore count.""" """arg is bp number followed by ignore count."""
args = arg.split() args = arg.split()
bpnum = int(args[0].strip()) try:
bpnum = int(args[0].strip())
except ValueError:
# something went wrong
print >>self.stdout, \
'Breakpoint index %r is not a number' % args[0]
try: try:
count = int(args[1].strip()) count = int(args[1].strip())
except: except:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment