Skip to content

Commit 49db28a

Browse files
committed
fix: EXT_SUFFIX wrong before 3.8.7
Signed-off-by: Henry Schreiner <[email protected]>
1 parent b9dc3d4 commit 49db28a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/scikit_build_core/builder/builder.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import re
55
import sys
66
import sysconfig
7+
import typing
78
from pathlib import Path
89
from typing import Mapping
910

@@ -120,7 +121,15 @@ def configure(
120121
# Workaround for bug in PyPy and packaging that is not handled in CMake
121122
# According to PEP 3149, SOABI and EXT_SUFFIX are interchangeable (and
122123
# the latter is much more likely to be correct as it is used elsewhere)
123-
ext_suffix = sysconfig.get_config_var("EXT_SUFFIX")
124+
if sys.version_info < (3, 8, 7):
125+
# See https://github.com/python/cpython/issues/84006
126+
import distutils.sysconfig
127+
128+
ext_suffix = typing.cast(
129+
str, distutils.sysconfig.get_config_var("EXT_SUFFIX")
130+
)
131+
else:
132+
ext_suffix = sysconfig.get_config_var("EXT_SUFFIX")
124133
assert ext_suffix
125134
cache_config["SKBUILD_SOABI"] = ext_suffix.rsplit(".", 1)[0].lstrip(".")
126135

0 commit comments

Comments
 (0)