[Python-checkins] python/dist/src/Lib pdb.py,1.53,1.54

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Fri, 12 Jul 2002 06:10:56 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv26665

Modified Files:
	pdb.py 
Log Message:
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).


Index: pdb.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pdb.py,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** pdb.py	1 Jun 2002 14:18:46 -0000	1.53
--- pdb.py	12 Jul 2002 13:10:53 -0000	1.54
***************
*** 103,108 ****
              for line in rcLines:
                  line = line[:-1]
!                 if len (line) > 0 and line[0] != '#':
!                     self.onecmd (line)
  
      # Override Bdb methods (except user_call, for now)
--- 103,108 ----
              for line in rcLines:
                  line = line[:-1]
!                 if len(line) > 0 and line[0] != '#':
!                     self.onecmd(line)
  
      # Override Bdb methods (except user_call, for now)
***************
*** 152,156 ****
      def precmd(self, line):
          """Handle alias expansion and ';;' separator."""
!         if not line:
              return line
          args = line.split()
--- 152,156 ----
      def precmd(self, line):
          """Handle alias expansion and ';;' separator."""
!         if not line.strip():
              return line
          args = line.split()
***************
*** 322,327 ****
          line = line.strip()
          # Don't allow setting breakpoint at a blank line
!         if ( not line or (line[0] == '#') or
!              (line[:3] == '"""') or line[:3] == "'''" ):
              print '*** Blank or comment'
              return 0
--- 322,327 ----
          line = line.strip()
          # Don't allow setting breakpoint at a blank line
!         if (not line or (line[0] == '#') or
!              (line[:3] == '"""') or line[:3] == "'''"):
              print '*** Blank or comment'
              return 0
***************
*** 402,408 ****
          if bp:
              bp.ignore = count
!             if (count > 0):
                  reply = 'Will ignore next '
!                 if (count > 1):
                      reply = reply + '%d crossings' % count
                  else:
--- 402,408 ----
          if bp:
              bp.ignore = count
!             if count > 0:
                  reply = 'Will ignore next '
!                 if count > 1:
                      reply = reply + '%d crossings' % count
                  else:
***************
*** 615,619 ****
                  print "%s = %s" % (alias, self.aliases[alias])
              return
!         if args[0] in self.aliases and len (args) == 1:
              print "%s = %s" % (args[0], self.aliases[args[0]])
          else:
--- 615,619 ----
                  print "%s = %s" % (alias, self.aliases[alias])
              return
!         if args[0] in self.aliases and len(args) == 1:
              print "%s = %s" % (args[0], self.aliases[args[0]])
          else: