Files
MINGW-packages/mingw-w64-python/0101-distutils-split-CC-env-var-before-passing-to-subproc.patch
2023-10-03 09:04:31 +02:00

34 lines
1.2 KiB
Diff

From f741e96dcdc66d2faa8500ce1e51998a52c8659b Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sun, 7 Nov 2021 23:12:10 +0100
Subject: [PATCH 101/N] 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 #53
---
Lib/distutils/cygwinccompiler.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py
index 2804f69..6e22555 100644
--- a/Lib/distutils/cygwinccompiler.py
+++ b/Lib/distutils/cygwinccompiler.py
@@ -50,6 +50,7 @@ cygwin in no-cygwin mode).
import os
import sys
import copy
+import shlex
from distutils.unixccompiler import UnixCCompiler
from distutils.file_util import write_file
@@ -353,5 +354,5 @@ def check_config_h():
def is_cygwincc(cc):
'''Try to determine if the compiler that would be used is from cygwin.'''
- out_string = check_output([cc, '-dumpmachine'])
+ out_string = check_output(shlex.split(cc) + ['-dumpmachine'])
return out_string.strip().endswith(b'cygwin')