[Python-checkins] python/dist/src/Lib/distutils cmd.py, 1.35, 1.36 core.py, 1.58, 1.59 dir_util.py, 1.12, 1.13 dist.py, 1.63, 1.64 fancy_getopt.py, 1.27, 1.28 util.py, 1.73, 1.74

doerwalter at users.sourceforge.net doerwalter at users.sourceforge.net
Thu Feb 12 12:35:41 EST 2004


Update of /cvsroot/python/python/dist/src/Lib/distutils
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Lib/distutils

Modified Files:
	cmd.py core.py dir_util.py dist.py fancy_getopt.py util.py 
Log Message:
Replace backticks with repr() or "%r"

>From SF patch #852334.


Index: cmd.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/cmd.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** cmd.py	20 Oct 2003 14:01:51 -0000	1.35
--- cmd.py	12 Feb 2004 17:35:08 -0000	1.36
***************
*** 254,259 ****
              if not ok:
                  raise DistutilsOptionError, \
!                       "'%s' must be a list of strings (got %s)" % \
!                       (option, `val`)
  
      def _ensure_tested_string (self, option, tester,
--- 254,259 ----
              if not ok:
                  raise DistutilsOptionError, \
!                       "'%s' must be a list of strings (got %r)" % \
!                       (option, val)
  
      def _ensure_tested_string (self, option, tester,

Index: core.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/core.py,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** core.py	19 Feb 2003 14:16:00 -0000	1.58
--- core.py	12 Feb 2004 17:35:08 -0000	1.59
***************
*** 203,207 ****
      """
      if stop_after not in ('init', 'config', 'commandline', 'run'):
!         raise ValueError, "invalid value for 'stop_after': %s" % `stop_after`
  
      global _setup_stop_after, _setup_distribution
--- 203,207 ----
      """
      if stop_after not in ('init', 'config', 'commandline', 'run'):
!         raise ValueError, "invalid value for 'stop_after': %r" % (stop_after,)
  
      global _setup_stop_after, _setup_distribution

Index: dir_util.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/dir_util.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** dir_util.py	26 Nov 2002 17:42:48 -0000	1.12
--- dir_util.py	12 Feb 2004 17:35:08 -0000	1.13
***************
*** 34,38 ****
      if type(name) is not StringType:
          raise DistutilsInternalError, \
!               "mkpath: 'name' must be a string (got %s)" % `name`
  
      # XXX what's the better way to handle verbosity? print as we create
--- 34,38 ----
      if type(name) is not StringType:
          raise DistutilsInternalError, \
!               "mkpath: 'name' must be a string (got %r)" % (name,)
  
      # XXX what's the better way to handle verbosity? print as we create

Index: dist.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/dist.py,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -d -r1.63 -r1.64
*** dist.py	3 Mar 2003 20:07:27 -0000	1.63
--- dist.py	12 Feb 2004 17:35:08 -0000	1.64
***************
*** 526,532 ****
                      else:
                          raise DistutilsClassError(
!                             "invalid help function %s for help option '%s': "
                              "must be a callable object (function, etc.)"
!                             % (`func`, help_option))
  
              if help_option_found:
--- 526,532 ----
                      else:
                          raise DistutilsClassError(
!                             "invalid help function %r for help option '%s': "
                              "must be a callable object (function, etc.)"
!                             % (func, help_option))
  
              if help_option_found:

Index: fancy_getopt.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/fancy_getopt.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** fancy_getopt.py	19 Nov 2002 13:12:27 -0000	1.27
--- fancy_getopt.py	12 Feb 2004 17:35:08 -0000	1.28
***************
*** 163,167 ****
                  # the option table is part of the code, so simply
                  # assert that it is correct
!                 assert "invalid option tuple: %s" % `option`
  
              # Type- and value-check the option names
--- 163,167 ----
                  # the option table is part of the code, so simply
                  # assert that it is correct
!                 assert "invalid option tuple: %r" % (option,)
  
              # Type- and value-check the option names

Index: util.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/util.py,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -d -r1.73 -r1.74
*** util.py	6 Jan 2003 13:28:12 -0000	1.73
--- util.py	12 Feb 2004 17:35:08 -0000	1.74
***************
*** 286,290 ****
      """
      if msg is None:
!         msg = "%s%s" % (func.__name__, `args`)
          if msg[-2:] == ',)':        # correct for singleton tuple
              msg = msg[0:-2] + ')'
--- 286,290 ----
      """
      if msg is None:
!         msg = "%s%r" % (func.__name__, args)
          if msg[-2:] == ',)':        # correct for singleton tuple
              msg = msg[0:-2] + ')'
***************
*** 308,312 ****
          return 0
      else:
!         raise ValueError, "invalid truth value %s" % `val`
  
  
--- 308,312 ----
          return 0
      else:
!         raise ValueError, "invalid truth value %r" % (val,)
  
  
***************
*** 395,403 ****
              script.write(string.join(map(repr, py_files), ",\n") + "]\n")
              script.write("""
! byte_compile(files, optimize=%s, force=%s,
!              prefix=%s, base_dir=%s,
!              verbose=%s, dry_run=0,
               direct=1)
! """ % (`optimize`, `force`, `prefix`, `base_dir`, `verbose`))
  
              script.close()
--- 395,403 ----
              script.write(string.join(map(repr, py_files), ",\n") + "]\n")
              script.write("""
! byte_compile(files, optimize=%r, force=%r,
!              prefix=%r, base_dir=%r,
!              verbose=%r, dry_run=0,
               direct=1)
! """ % (optimize, force, prefix, base_dir, verbose))
  
              script.close()
***************
*** 433,438 ****
                  if file[:len(prefix)] != prefix:
                      raise ValueError, \
!                           ("invalid prefix: filename %s doesn't start with %s"
!                            % (`file`, `prefix`))
                  dfile = dfile[len(prefix):]
              if base_dir:
--- 433,438 ----
                  if file[:len(prefix)] != prefix:
                      raise ValueError, \
!                           ("invalid prefix: filename %r doesn't start with %r"
!                            % (file, prefix))
                  dfile = dfile[len(prefix):]
              if base_dir:




More information about the Python-checkins mailing list