mirror of
https://github.com/python/cpython.git
synced 2025-09-04 07:51:13 +00:00
Fix SF bug 579701 (Fernando Pérez); an input line consisting of one or
more spaces only crashed pdb. While I was at it, cleaned up some style nits (spaces between function and parenthesis, and redundant parentheses in if statement).
This commit is contained in:
parent
2ad9419c8f
commit
08454596d1
1 changed files with 8 additions and 8 deletions
|
@ -151,7 +151,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
|
||||||
|
|
||||||
def precmd(self, line):
|
def precmd(self, line):
|
||||||
"""Handle alias expansion and ';;' separator."""
|
"""Handle alias expansion and ';;' separator."""
|
||||||
if not line:
|
if not line.strip():
|
||||||
return line
|
return line
|
||||||
args = line.split()
|
args = line.split()
|
||||||
while args[0] in self.aliases:
|
while args[0] in self.aliases:
|
||||||
|
@ -401,9 +401,9 @@ class Pdb(bdb.Bdb, cmd.Cmd):
|
||||||
bp = bdb.Breakpoint.bpbynumber[bpnum]
|
bp = bdb.Breakpoint.bpbynumber[bpnum]
|
||||||
if bp:
|
if bp:
|
||||||
bp.ignore = count
|
bp.ignore = count
|
||||||
if (count > 0):
|
if count > 0:
|
||||||
reply = 'Will ignore next '
|
reply = 'Will ignore next '
|
||||||
if (count > 1):
|
if count > 1:
|
||||||
reply = reply + '%d crossings' % count
|
reply = reply + '%d crossings' % count
|
||||||
else:
|
else:
|
||||||
reply = reply + '1 crossing'
|
reply = reply + '1 crossing'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue