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:
Guido van Rossum 2002-07-12 13:10:53 +00:00
parent 2ad9419c8f
commit 08454596d1

View file

@ -151,7 +151,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
def precmd(self, line):
"""Handle alias expansion and ';;' separator."""
if not line:
if not line.strip():
return line
args = line.split()
while args[0] in self.aliases:
@ -401,9 +401,9 @@ class Pdb(bdb.Bdb, cmd.Cmd):
bp = bdb.Breakpoint.bpbynumber[bpnum]
if bp:
bp.ignore = count
if (count > 0):
if count > 0:
reply = 'Will ignore next '
if (count > 1):
if count > 1:
reply = reply + '%d crossings' % count
else:
reply = reply + '1 crossing'