From 3e8662aaa750c20d3a96f1b27dc9bc768ec8e997 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 17 May 2017 09:37:06 -0700 Subject: [PATCH] fix bug with executables setting their own environment. (#4237) --- lib/spack/spack/util/executable.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/util/executable.py b/lib/spack/spack/util/executable.py index 44865e7bdb0..c7e445971b8 100644 --- a/lib/spack/spack/util/executable.py +++ b/lib/spack/spack/util/executable.py @@ -130,12 +130,13 @@ def __call__(self, *args, **kwargs): 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)