diff options
Diffstat (limited to 'setuptools/_distutils/spawn.py')
-rw-r--r-- | setuptools/_distutils/spawn.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/setuptools/_distutils/spawn.py b/setuptools/_distutils/spawn.py index b2d10e39..afefe525 100644 --- a/setuptools/_distutils/spawn.py +++ b/setuptools/_distutils/spawn.py @@ -10,12 +10,12 @@ import sys import os import subprocess -from distutils.errors import DistutilsExecError -from distutils.debug import DEBUG -from distutils import log +from .errors import DistutilsExecError +from .debug import DEBUG +from ._log import log -def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None): +def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None): # noqa: C901 """Run another program, specified as a command list 'cmd', in a new process. 'cmd' is just the argument list for the new process, ie. @@ -48,6 +48,7 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None): if sys.platform == 'darwin': from distutils.util import MACOSX_VERSION_VAR, get_macosx_target_ver + macosx_target_ver = get_macosx_target_ver() if macosx_target_ver: env[MACOSX_VERSION_VAR] = macosx_target_ver @@ -60,13 +61,15 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None): if not DEBUG: cmd = cmd[0] raise DistutilsExecError( - "command %r failed: %s" % (cmd, exc.args[-1])) from exc + "command {!r} failed: {}".format(cmd, exc.args[-1]) + ) from exc if exitcode: if not DEBUG: cmd = cmd[0] raise DistutilsExecError( - "command %r failed with exit code %s" % (cmd, exitcode)) + "command {!r} failed with exit code {}".format(cmd, exitcode) + ) def find_executable(executable, path=None): |