diff --git a/src/isolated_environment/api.py b/src/isolated_environment/api.py index 88a44d8..3e641ec 100644 --- a/src/isolated_environment/api.py +++ b/src/isolated_environment/api.py @@ -221,8 +221,10 @@ def run(self, cmd_list: list[str], **kwargs) -> subprocess.CompletedProcess: ) ): cmd_list[0] = str(act_env.pip) + shell = kwargs.get("shell", False) + cmd_or_cmd_list = subprocess.list2cmdline(cmd_list) if shell else cmd_list cp = subprocess.run( - cmd_list, + cmd_or_cmd_list, env=env, check=check, text=text, diff --git a/tests/test_git.py b/tests/test_git.py index a8cceaa..def9113 100644 --- a/tests/test_git.py +++ b/tests/test_git.py @@ -53,7 +53,9 @@ def test_git_is_still_installed(self) -> None: ) activated_env = iso_env.environment() # now create an inner environment without the static-ffmpeg - cp: subprocess.CompletedProcess = iso_env.run(["git", "--help"], shell=True) + cp: subprocess.CompletedProcess = iso_env.run( + ["git", "--version"], shell=True, capture_output=True + ) if cp.returncode != 0: warning_message = [ "git had some sort of a problem, dumping out the system"