diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-07-12 04:58:34 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-07-12 04:58:34 -0400 |
| commit | b5e6a92ef6daa64245c52e87e4e296e6dba5b29f (patch) | |
| tree | 7c0c17de818702e24657c54c72ee7700c113160c /distutils/spawn.py | |
| parent | c4e3afb3f559f6cbe0f29ad908de8b05b993fb5f (diff) | |
| parent | 30de1af5460998284435dc8ec63dc259f1ef96de (diff) | |
| download | python-setuptools-git-b5e6a92ef6daa64245c52e87e4e296e6dba5b29f.tar.gz | |
Merge branch 'clean'
Diffstat (limited to 'distutils/spawn.py')
| -rw-r--r-- | distutils/spawn.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/distutils/spawn.py b/distutils/spawn.py index 0d1bd039..fc592d4a 100644 --- a/distutils/spawn.py +++ b/distutils/spawn.py @@ -20,7 +20,7 @@ if sys.platform == 'darwin': _cfg_target_split = None -def spawn(cmd, search_path=1, verbose=0, dry_run=0): +def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None): """Run another program, specified as a command list 'cmd', in a new process. 'cmd' is just the argument list for the new process, ie. @@ -49,7 +49,8 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0): if executable is not None: cmd[0] = executable - env = None + env = env if env is not None else dict(os.environ) + if sys.platform == 'darwin': global _cfg_target, _cfg_target_split if _cfg_target is None: @@ -68,8 +69,7 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0): 'now "%s" but "%s" during configure' % (cur_target, _cfg_target)) raise DistutilsPlatformError(my_msg) - env = dict(os.environ, - MACOSX_DEPLOYMENT_TARGET=cur_target) + env.update(MACOSX_DEPLOYMENT_TARGET=cur_target) try: proc = subprocess.Popen(cmd, env=env) |
