dont overwrite os.environ
@@ -3544,8 +3544,6 @@ If you are sure that your working directory is valid, try running `cd $(pwd)`.""
##################
# Set environment variables
- # Save current environment
- environment = copy.deepcopy(os.environ)
# License file configuration.
for item in self.getkeys('tool', tool, 'licenseserver'):
@@ -3730,9 +3728,6 @@ If you are sure that your working directory is valid, try running `cd $(pwd)`.""
sys.stdout.write(stderr_reader.read())
retcode = proc.returncode
- # Restore enviroment
- os.environ = environment
-
if retcode != 0:
msg = f'Command failed with code {retcode}.'
if logfile:
@@ -4226,7 +4221,8 @@ If you are sure that your working directory is valid, try running `cd $(pwd)`.""
self.set('flowgraph', flow, step, index, 'status', TaskStatus.ERROR)
# Restore enviroment
- os.environ = environment
+ os.environ.clear()
+ os.environ.update(environment)
# Clear scratchpad args since these are checked on run() entry
self.set('arg', 'step', None, clobber=True)
