Files
MINGW-packages/mingw-w64-python/0117-distutils-split-CC-env-var-before-passing-to-subproc.patch
2022-06-10 17:54:24 +02:00

37 lines
1.2 KiB
Diff

From 5a85f6dc5e32eb4ea0282705275fb4b586a087de 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 117/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')
--
2.36.1