[Python-checkins] r53525 - python/branches/release25-maint/Lib/pdb.py

georg.brandl python-checkins at python.org
Mon Jan 22 22:23:45 CET 2007


Author: georg.brandl
Date: Mon Jan 22 22:23:45 2007
New Revision: 53525

Modified:
   python/branches/release25-maint/Lib/pdb.py
Log:
Bug #1627316: handle error in condition/ignore pdb commands more gracefully.
 (backport from rev. 53524)

Modified: python/branches/release25-maint/Lib/pdb.py
==============================================================================
--- python/branches/release25-maint/Lib/pdb.py	(original)
+++ python/branches/release25-maint/Lib/pdb.py	Mon Jan 22 22:23:45 2007
@@ -474,7 +474,12 @@
     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 @@
     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:


More information about the Python-checkins mailing list