summaryrefslogtreecommitdiff
path: root/distutils/_msvccompiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'distutils/_msvccompiler.py')
-rw-r--r--distutils/_msvccompiler.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/distutils/_msvccompiler.py b/distutils/_msvccompiler.py
index af8099a4..0e98692e 100644
--- a/distutils/_msvccompiler.py
+++ b/distutils/_msvccompiler.py
@@ -501,12 +501,8 @@ class MSVCCompiler(CCompiler) :
log.debug("skipping %s (up-to-date)", output_filename)
def spawn(self, cmd):
- old_path = os.getenv('path')
- try:
- os.environ['path'] = self._paths
- return super().spawn(cmd)
- finally:
- os.environ['path'] = old_path
+ env = dict(os.environ, path=self._paths)
+ return super().spawn(cmd, env=env)
# -- Miscellaneous methods -----------------------------------------
# These are all used by the 'gen_lib_options() function, in