Skip to content

Commit 28f8b0c

Browse files
committed
distutils: split CC env var before passing to subprocess
In case CC="ccache gcc" then subprocess would interpret it as one command and fail to find it. Instead split the command line into separate arguments. Fixes python#53
1 parent bc6088b commit 28f8b0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/distutils/cygwinccompiler.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import os
5151
import sys
5252
import copy
53+
import shlex
5354

5455
from distutils.unixccompiler import UnixCCompiler
5556
from distutils.file_util import write_file
@@ -353,5 +354,5 @@ def check_config_h():
353354

354355
def is_cygwincc(cc):
355356
'''Try to determine if the compiler that would be used is from cygwin.'''
356-
out_string = check_output([cc, '-dumpmachine'])
357+
out_string = check_output(shlex.split(cc) + ['-dumpmachine'])
357358
return out_string.strip().endswith(b'cygwin')

0 commit comments

Comments
 (0)