From 08454596d1390dbee114ce48d8ed24160057145c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 12 Jul 2002 13:10:53 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20SF=20bug=20579701=20(Fernando=20P=C3=A9re?= =?UTF-8?q?z);=20an=20input=20line=20consisting=20of=20one=20or=20more=20s?= =?UTF-8?q?paces=20only=20crashed=20pdb.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While I was at it, cleaned up some style nits (spaces between function and parenthesis, and redundant parentheses in if statement). --- Lib/pdb.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Lib/pdb.py b/Lib/pdb.py index 229aa64071b..3786ed97b5e 100755 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -102,8 +102,8 @@ def execRcLines(self): self.rcLines = [] for line in rcLines: line = line[:-1] - if len (line) > 0 and line[0] != '#': - self.onecmd (line) + if len(line) > 0 and line[0] != '#': + self.onecmd(line) # Override Bdb methods (except user_call, for now) @@ -151,7 +151,7 @@ def default(self, line): 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: @@ -321,8 +321,8 @@ def checkline(self, filename, lineno): return 0 line = line.strip() # Don't allow setting breakpoint at a blank line - if ( not line or (line[0] == '#') or - (line[:3] == '"""') or line[:3] == "'''" ): + if (not line or (line[0] == '#') or + (line[:3] == '"""') or line[:3] == "'''"): print '*** Blank or comment' return 0 # When a file is read in and a breakpoint is at @@ -401,9 +401,9 @@ def do_ignore(self,arg): 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' @@ -614,7 +614,7 @@ def do_alias(self, arg): for alias in keys: print "%s = %s" % (alias, self.aliases[alias]) return - if args[0] in self.aliases and len (args) == 1: + if args[0] in self.aliases and len(args) == 1: print "%s = %s" % (args[0], self.aliases[args[0]]) else: self.aliases[args[0]] = ' '.join(args[1:])