Commit 2faa9e14 authored by Collin Winter's avatar Collin Winter

Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap the...

Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap the IndexError caused by passing in an invalid breakpoint number.
Will backport.
parent 89032087
...@@ -485,7 +485,11 @@ class Pdb(bdb.Bdb, cmd.Cmd): ...@@ -485,7 +485,11 @@ class Pdb(bdb.Bdb, cmd.Cmd):
cond = args[1] cond = args[1]
except: except:
cond = None cond = None
try:
bp = bdb.Breakpoint.bpbynumber[bpnum] bp = bdb.Breakpoint.bpbynumber[bpnum]
except IndexError:
print >>self.stdout, 'Breakpoint index %r is not valid' % args[0]
return
if bp: if bp:
bp.cond = cond bp.cond = cond
if not cond: if not cond:
...@@ -506,7 +510,11 @@ class Pdb(bdb.Bdb, cmd.Cmd): ...@@ -506,7 +510,11 @@ class Pdb(bdb.Bdb, cmd.Cmd):
count = int(args[1].strip()) count = int(args[1].strip())
except: except:
count = 0 count = 0
try:
bp = bdb.Breakpoint.bpbynumber[bpnum] bp = bdb.Breakpoint.bpbynumber[bpnum]
except IndexError:
print >>self.stdout, 'Breakpoint index %r is not valid' % args[0]
return
if bp: if bp:
bp.ignore = count bp.ignore = count
if count > 0: if count > 0:
......
...@@ -158,6 +158,9 @@ Core and builtins ...@@ -158,6 +158,9 @@ Core and builtins
Library 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() - Patch #1599845: Add an option to disable the implicit calls to server_bind()
and server_activate() in the constructors for TCPServer, SimpleXMLRPCServer and server_activate() in the constructors for TCPServer, SimpleXMLRPCServer
and DocXMLRPCServer. and DocXMLRPCServer.
......
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