summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2017-05-17 09:37:06 -0700
committerAdam J. Stewart <ajstewart426@gmail.com>2017-05-17 11:37:06 -0500
commit3e8662aaa750c20d3a96f1b27dc9bc768ec8e997 (patch)
tree4c64afb81a35a79bcd2509aa5d34d92dd7712ada /lib
parentcafc3cc3ca5c457d6dcf4fafcb0c94ddedead0e7 (diff)
downloadspack-3e8662aaa750c20d3a96f1b27dc9bc768ec8e997.tar.gz
spack-3e8662aaa750c20d3a96f1b27dc9bc768ec8e997.tar.bz2
spack-3e8662aaa750c20d3a96f1b27dc9bc768ec8e997.tar.xz
spack-3e8662aaa750c20d3a96f1b27dc9bc768ec8e997.zip
fix bug with executables setting their own environment. (#4237)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/util/executable.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/spack/spack/util/executable.py b/lib/spack/spack/util/executable.py
index 44865e7bdb..c7e445971b 100644
--- a/lib/spack/spack/util/executable.py
+++ b/lib/spack/spack/util/executable.py
@@ -130,12 +130,13 @@ class Executable(object):
ignore_errors = kwargs.pop("ignore_errors", ())
# environment
- env = kwargs.get('env', None)
- if env is None:
+ env_arg = kwargs.get('env', None)
+ if env_arg is None:
env = os.environ.copy()
env.update(self.default_env)
else:
- env = self.default_env.copy().update(env)
+ env = self.default_env.copy()
+ env.update(env_arg)
# TODO: This is deprecated. Remove in a future version.
return_output = kwargs.pop("return_output", False)