summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-08-21 15:47:13 -0400
committerJason R. Coombs <jaraco@jaraco.com>2022-08-21 15:51:07 -0400
commit22b9bcf2e2d2a66f7dc96661312972e2f6bd9e01 (patch)
treedb078224d885929de44b1ca34593046b27364e74
parent610da0bd4e3fb69690b52777e9de51b27933e66c (diff)
parent5152a55c9fdbb76f5bfc9035521d7d7ad2054166 (diff)
downloadpython-setuptools-git-22b9bcf2e2d2a66f7dc96661312972e2f6bd9e01.tar.gz
Merge pull request pypa/distutils#173 from rnhmjoj/main
Fix, again, finding headers during cross compiling
-rw-r--r--distutils/sysconfig.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/distutils/sysconfig.py b/distutils/sysconfig.py
index aae9c1b3..3dd8185f 100644
--- a/distutils/sysconfig.py
+++ b/distutils/sysconfig.py
@@ -164,10 +164,19 @@ def _get_python_inc_from_config(plat_specific, spec_prefix):
the host
platform Python installation, while the current Python
executable is from the build platform installation.
+
+ >>> monkeypatch = getfixture('monkeypatch')
+ >>> gpifc = _get_python_inc_from_config
+ >>> monkeypatch.setitem(gpifc.__globals__, 'get_config_var', str.lower)
+ >>> gpifc(False, '/usr/bin/')
+ >>> gpifc(False, '')
+ >>> gpifc(False, None)
+ 'includepy'
+ >>> gpifc(True, None)
+ 'confincludepy'
"""
- if not spec_prefix:
- return
- return get_config_var('CONF' * plat_specific + 'INCLUDEPY')
+ if spec_prefix is None:
+ return get_config_var('CONF' * plat_specific + 'INCLUDEPY')
def _get_python_inc_posix_prefix(prefix):