diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2023-02-06 20:09:55 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-06 20:09:55 -0500 |
| commit | bb17d4f9b23b3b8d670271f36d8894239295efe3 (patch) | |
| tree | 38943cabf4e65c9b393ea765410968d39f7c1521 /setuptools/_distutils/sysconfig.py | |
| parent | 8032430d75cdfad9f9826d302d90cd7b23dea3ca (diff) | |
| parent | 47c7cfd67862e65eb19dca8b60094db0fe203049 (diff) | |
| download | python-setuptools-git-bb17d4f9b23b3b8d670271f36d8894239295efe3.tar.gz | |
Merge pull request #3809 from pypa/distutils-8c3c3d29
Merge with distutils@8c3c3d29
Diffstat (limited to 'setuptools/_distutils/sysconfig.py')
| -rw-r--r-- | setuptools/_distutils/sysconfig.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/setuptools/_distutils/sysconfig.py b/setuptools/_distutils/sysconfig.py index 0ec69366..a40a7231 100644 --- a/setuptools/_distutils/sysconfig.py +++ b/setuptools/_distutils/sysconfig.py @@ -130,12 +130,20 @@ def get_python_inc(plat_specific=0, prefix=None): return getter(resolved_prefix, prefix, plat_specific) +@pass_none +def _extant(path): + """ + Replace path with None if it doesn't exist. + """ + return path if os.path.exists(path) else None + + def _get_python_inc_posix(prefix, spec_prefix, plat_specific): if IS_PYPY and sys.version_info < (3, 8): return os.path.join(prefix, 'include') return ( _get_python_inc_posix_python(plat_specific) - or _get_python_inc_from_config(plat_specific, spec_prefix) + or _extant(_get_python_inc_from_config(plat_specific, spec_prefix)) or _get_python_inc_posix_prefix(prefix) ) @@ -474,7 +482,6 @@ def parse_makefile(fn, g=None): # noqa: C901 del notdone[name] if name.startswith('PY_') and name[3:] in renamed_variables: - name = name[3:] if name not in done: done[name] = value |
