summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)