Skip to content

Commit 49d6d94

Browse files
committed
avoid shell=true on windows
1 parent 76dcc16 commit 49d6d94

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

tests/utils.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
IS_WINDOWS = platform.system() == "Windows"
99

10-
if IS_WINDOWS:
11-
printenv_cmd = ["cmd", "/c", "echo", "%a%"]
12-
else:
13-
printenv_cmd = ["printenv", "a"]
14-
1510

1611
@contextmanager
1712
def pushd(path):
@@ -51,9 +46,8 @@ def run_command(
5146
# Convert string command to list for subprocess if needed
5247
if isinstance(cmd, str):
5348
if IS_WINDOWS:
54-
# Windows needs shell=True for built-ins
5549
result = subprocess.run(
56-
cmd, env=env, shell=True, text=True, capture_output=capture_output
50+
cmd, env=env, text=True, capture_output=capture_output
5751
)
5852
else:
5953
# For Unix, better to split the command

0 commit comments

Comments
 (0)