fix bug with executables setting their own environment. (#4237)

This commit is contained in:
Todd Gamblin 2017-05-17 09:37:06 -07:00 committed by Adam J. Stewart
parent cafc3cc3ca
commit 3e8662aaa7

View File

@ -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)