From 3e8662aaa750c20d3a96f1b27dc9bc768ec8e997 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 17 May 2017 09:37:06 -0700 Subject: fix bug with executables setting their own environment. (#4237) --- lib/spack/spack/util/executable.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3-70-g09d2