File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1778,26 +1778,30 @@ def __init__(self):
1778
1778
# Basic install of dev tools with `xcode-select --install` doesn't
1779
1779
# seem to provide a `python3-config` or similar, but there is a
1780
1780
# `python-config.py` accessible via sysconfig.
1781
+ #
1782
+ # We try different possibilities and use the last one that
1783
+ # works.
1784
+ #
1781
1785
python_config = None
1782
1786
for pc in (
1783
- f'{ python_exe } -config' ,
1784
- f'{ sys .executable } { sysconfig .get_config_var ("srcdir" )} /python-config.py' ,
1785
1787
f'python3-config' ,
1788
+ f'{ sys .executable } { sysconfig .get_config_var ("srcdir" )} /python-config.py' ,
1789
+ f'{ python_exe } -config' ,
1786
1790
):
1787
- log2 (f'Trying: { pc = } ' )
1788
1791
e = subprocess .run (
1789
1792
f'{ pc } --includes' ,
1790
1793
shell = 1 ,
1791
1794
stdout = subprocess .DEVNULL ,
1792
1795
stderr = subprocess .DEVNULL ,
1793
1796
check = 0 ,
1794
1797
).returncode
1795
- log2 (f'{ e = } ' )
1798
+ log1 (f'{ e = } from { pc !r } . ' )
1796
1799
if e == 0 :
1797
1800
python_config = pc
1798
1801
assert python_config , f'Cannot find python-config'
1799
1802
else :
1800
1803
python_config = f'{ python_exe } -config'
1804
+ log1 (f'Using { python_config = } .' )
1801
1805
self .includes = run ( f'{ python_config } --includes' , capture = 1 ).strip ()
1802
1806
#if darwin():
1803
1807
# self.ldflags =
You can’t perform that action at this time.
0 commit comments