Index: pylib/gyp/win_tool.py |
diff --git a/pylib/gyp/win_tool.py b/pylib/gyp/win_tool.py |
index 194bf3da9a74317a08da0e752bfa4a4e3f4c1b1b..1c843a0b6cf528b4888273c5ed0b45c69ffbf987 100755 |
--- a/pylib/gyp/win_tool.py |
+++ b/pylib/gyp/win_tool.py |
@@ -119,7 +119,15 @@ class WinTool(object): |
if sys.platform == 'win32': |
args = list(args) # *args is a tuple by default, which is read-only. |
args[0] = args[0].replace('/', '\\') |
- link = subprocess.Popen(args, shell=True, env=env, |
+ # https://docs.python.org/2/library/subprocess.html: |
+ # "On Unix with shell=True [...] if args is a sequence, the first item |
+ # specifies the command string, and any additional items will be treated as |
+ # additional arguments to the shell itself. That is to say, Popen does the |
+ # equivalent of: |
+ # Popen(['/bin/sh', '-c', args[0], args[1], ...])" |
+ # For that reason, since going through the shell doesn't seem necessary on |
+ # non-Windows don't do that there. |
+ link = subprocess.Popen(args, shell=sys.platform == 'win32', env=env, |
stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
out, _ = link.communicate() |
for line in out.splitlines(): |