Skip to content

Commit c18f38c

Browse files
fix: EXT_SUFFIX wrong before 3.8.7 (#160)
This was fixed in CPython 3.8.7. Signed-off-by: Henry Schreiner <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e068451 commit c18f38c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/scikit_build_core/builder/builder.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,14 @@ def configure(
120120
# Workaround for bug in PyPy and packaging that is not handled in CMake
121121
# According to PEP 3149, SOABI and EXT_SUFFIX are interchangeable (and
122122
# the latter is much more likely to be correct as it is used elsewhere)
123-
ext_suffix = sysconfig.get_config_var("EXT_SUFFIX")
124-
assert ext_suffix
123+
if sys.version_info < (3, 8, 7):
124+
# See https://github.com/python/cpython/issues/84006
125+
import distutils.sysconfig # pylint: disable=deprecated-module
126+
127+
ext_suffix = distutils.sysconfig.get_config_var("EXT_SUFFIX")
128+
else:
129+
ext_suffix = sysconfig.get_config_var("EXT_SUFFIX")
130+
assert isinstance(ext_suffix, str)
125131
cache_config["SKBUILD_SOABI"] = ext_suffix.rsplit(".", 1)[0].lstrip(".")
126132

127133
if cache_entries:

0 commit comments

Comments
 (0)