diff options
| author | Collin Winter <collinw@gmail.com> | 2007-03-11 16:00:20 (GMT) |
|---|---|---|
| committer | Collin Winter <collinw@gmail.com> | 2007-03-11 16:00:20 (GMT) |
| commit | 2faa9e146681bb4d5ea2b795dfaade35a1d1c2df (patch) | |
| tree | 08c68c9b392a4b172d90a741f7cfeaf04a622dec | |
| parent | 890320877658121d9def472ae0d7063b81fc3aed (diff) | |
| download | cpython-2faa9e146681bb4d5ea2b795dfaade35a1d1c2df.zip cpython-2faa9e146681bb4d5ea2b795dfaade35a1d1c2df.tar.gz cpython-2faa9e146681bb4d5ea2b795dfaade35a1d1c2df.tar.bz2 | |
Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap the IndexError caused by passing in an invalid breakpoint number.
Will backport.
| -rwxr-xr-x | Lib/pdb.py | 12 | ||||
| -rw-r--r-- | Misc/NEWS | 3 |
2 files changed, 13 insertions, 2 deletions
@@ -485,7 +485,11 @@ class Pdb(bdb.Bdb, cmd.Cmd): cond = args[1] except: cond = None - bp = bdb.Breakpoint.bpbynumber[bpnum] + try: + bp = bdb.Breakpoint.bpbynumber[bpnum] + except IndexError: + print >>self.stdout, 'Breakpoint index %r is not valid' % args[0] + return if bp: bp.cond = cond if not cond: @@ -506,7 +510,11 @@ class Pdb(bdb.Bdb, cmd.Cmd): count = int(args[1].strip()) except: count = 0 - bp = bdb.Breakpoint.bpbynumber[bpnum] + try: + bp = bdb.Breakpoint.bpbynumber[bpnum] + except IndexError: + print >>self.stdout, 'Breakpoint index %r is not valid' % args[0] + return if bp: bp.ignore = count if count > 0: @@ -158,6 +158,9 @@ Core and builtins Library ------- +- Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap + the IndexError caused by passing in an invalid breakpoint number. + - Patch #1599845: Add an option to disable the implicit calls to server_bind() and server_activate() in the constructors for TCPServer, SimpleXMLRPCServer and DocXMLRPCServer. |
