diff options
author | Georg Brandl <georg@python.org> | 2007-01-22 21:23:41 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-01-22 21:23:41 (GMT) |
commit | e498083b59d561294596f16e34166fa1692909ac (patch) | |
tree | 4a0048d38c7d2f68137c0b807bda64f36681d655 | |
parent | 626349526e2d26a58cc92319983aa9a7309fe06d (diff) | |
download | cpython-e498083b59d561294596f16e34166fa1692909ac.zip cpython-e498083b59d561294596f16e34166fa1692909ac.tar.gz cpython-e498083b59d561294596f16e34166fa1692909ac.tar.bz2 |
Bug #1627316: handle error in condition/ignore pdb commands more gracefully.
-rwxr-xr-x | Lib/pdb.py | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -474,7 +474,12 @@ class Pdb(bdb.Bdb, cmd.Cmd): def do_condition(self, arg): # arg is breakpoint number and condition 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: cond = args[1] except: @@ -489,7 +494,12 @@ class Pdb(bdb.Bdb, cmd.Cmd): def do_ignore(self,arg): """arg is bp number followed by ignore count.""" 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: count = int(args[1].strip()) except: |