Skip to content

Commit 22b9bcf

Browse files
committed
Merge pull request #173 from rnhmjoj/main
Fix, again, finding headers during cross compiling
2 parents 610da0b + 5152a55 commit 22b9bcf

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

distutils/sysconfig.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,19 @@ def _get_python_inc_from_config(plat_specific, spec_prefix):
164164
the host
165165
platform Python installation, while the current Python
166166
executable is from the build platform installation.
167+
168+
>>> monkeypatch = getfixture('monkeypatch')
169+
>>> gpifc = _get_python_inc_from_config
170+
>>> monkeypatch.setitem(gpifc.__globals__, 'get_config_var', str.lower)
171+
>>> gpifc(False, '/usr/bin/')
172+
>>> gpifc(False, '')
173+
>>> gpifc(False, None)
174+
'includepy'
175+
>>> gpifc(True, None)
176+
'confincludepy'
167177
"""
168-
if not spec_prefix:
169-
return
170-
return get_config_var('CONF' * plat_specific + 'INCLUDEPY')
178+
if spec_prefix is None:
179+
return get_config_var('CONF' * plat_specific + 'INCLUDEPY')
171180

172181

173182
def _get_python_inc_posix_prefix(prefix):

0 commit comments

Comments
 (0)