Commit 46dd1d74 by Arun Babu Neelicattu Committed by finswimmer

env: handle shell commands correctly

Previously, environment run method handled shell commands incorrectly
for windows platforms. This change ensures that command list to shell
conversion occurs after shell option is enforced.
parent 1598dfff
...@@ -908,16 +908,16 @@ class Env(object): ...@@ -908,16 +908,16 @@ class Env(object):
""" """
Run a command inside the Python environment. Run a command inside the Python environment.
""" """
shell = kwargs.get("shell", False)
call = kwargs.pop("call", False) call = kwargs.pop("call", False)
input_ = kwargs.pop("input_", None) input_ = kwargs.pop("input_", None)
if shell:
cmd = list_to_shell_command(cmd)
try: try:
if self._is_windows: if self._is_windows:
kwargs["shell"] = True kwargs["shell"] = True
if kwargs.get("shell", False):
cmd = list_to_shell_command(cmd)
if input_: if input_:
output = subprocess.run( output = subprocess.run(
cmd, cmd,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment