Skip to content

Commit 1da4887

Browse files
author
ajohns
committed
-fixed bug where parent_environ was not being set into the target env dict in ResolvedContext.execute_command
1 parent d9e83b8 commit 1da4887

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/rez/resolved_context.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,13 @@ def execute_command(self, args, parent_environ=None, **subprocess_kwargs):
10931093
Note:
10941094
This does not alter the current python session.
10951095
"""
1096-
interpreter = Python(target_environ={})
1096+
if parent_environ in (None, os.environ):
1097+
target_environ = {}
1098+
else:
1099+
target_environ = parent_environ.copy()
1100+
1101+
interpreter = Python(target_environ=target_environ)
1102+
10971103
executor = self._create_executor(interpreter, parent_environ)
10981104
self._execute(executor)
10991105
return interpreter.subprocess(args, **subprocess_kwargs)

0 commit comments

Comments
 (0)