]> granicus.if.org Git - python/commitdiff
Merge 3.3 (#11599)
authorÉric Araujo <merwok@netwok.org>
Thu, 13 Mar 2014 09:59:31 +0000 (05:59 -0400)
committerÉric Araujo <merwok@netwok.org>
Thu, 13 Mar 2014 09:59:31 +0000 (05:59 -0400)
1  2 
Lib/distutils/spawn.py
Misc/NEWS

index b1c5a442a5dac9e06eb3003a9ec81bcc3bbd463a,f66ff93dfb0d71ffbc1184954e42f33624b3aa7a..d9cf950a9b0fa315dd6758336c192665ea7af9aa
@@@ -65,13 -71,41 +71,17 @@@ def _spawn_nt(cmd, search_path=1, verbo
              rc = os.spawnv(os.P_WAIT, executable, cmd)
          except OSError as exc:
              # this seems to happen when the command isn't found
+             if not DEBUG:
+                 cmd = executable
              raise DistutilsExecError(
-                   "command '%s' failed: %s" % (cmd[0], exc.args[-1]))
+                   "command %r failed: %s" % (cmd, exc.args[-1]))
          if rc != 0:
              # and this reflects the command running but failing
+             if not DEBUG:
+                 cmd = executable
              raise DistutilsExecError(
-                   "command '%s' failed with exit status %d" % (cmd[0], rc))
+                   "command %r failed with exit status %d" % (cmd, rc))
  
 -def _spawn_os2(cmd, search_path=1, verbose=0, dry_run=0):
 -    executable = cmd[0]
 -    if search_path:
 -        # either we find one or it stays the same
 -        executable = find_executable(executable) or executable
 -    log.info(' '.join([executable] + cmd[1:]))
 -    if not dry_run:
 -        # spawnv for OS/2 EMX requires a full path to the .exe
 -        try:
 -            rc = os.spawnv(os.P_WAIT, executable, cmd)
 -        except OSError as exc:
 -            # this seems to happen when the command isn't found
 -            if not DEBUG:
 -                cmd = executable
 -            raise DistutilsExecError(
 -                  "command %r failed: %s" % (cmd, exc.args[-1]))
 -        if rc != 0:
 -            # and this reflects the command running but failing
 -            if not DEBUG:
 -                cmd = executable
 -            log.debug("command %r failed with exit status %d" % (cmd, rc))
 -            raise DistutilsExecError(
 -                  "command %r failed with exit status %d" % (cmd, rc))
 -
  if sys.platform == 'darwin':
      from distutils import sysconfig
      _cfg_target = None
diff --cc Misc/NEWS
index e69874fd42eb9d00e2a7e9653947d89bf856758d,253c850b5ac2764fee3d6ebb7f30cfbbd78828cc..35693c1602ddd3c19d8170036fa45e38f88a6cb8
+++ b/Misc/NEWS
@@@ -20,9 -13,13 +20,13 @@@ Core and Builtin
  Library
  -------
  
 -- Issue #20875: Prevent possible gzip "'read' is not defined" NameError.
 -  Patch by Claudiu Popa.
 +- Issue #19157: Include the broadcast address in the usuable hosts for IPv6
 +  in ipaddress.
  
+ - Issue #11599: When an external command (e.g. compiler) fails, distutils now
+   prints out the whole command line (instead of just the command name) if the
+   environment variable DISTUTILS_DEBUG is set.
  - Issue #4931: distutils should not produce unhelpful "error: None" messages
    anymore.  distutils.util.grok_environment_error is kept but doc-deprecated.