Skip to content

Commit a1d8b27

Browse files
vstinnerqwhelan
authored andcommitted
Fix get_python_header_include() for Python 3.10
Don't use sys.version[:3] which doesn't work on "3.10.0a6 (...)" string.
1 parent f2bc792 commit a1d8b27

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bottleneck/src/bn_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def get_python_header_include() -> List[str]:
2424
if sys.platform == "win32":
2525
suffix = ["include"]
2626
else:
27-
suffix = ["include", "python" + sys.version[:3] + sys.abiflags]
27+
python_ver = "python{0.major}.{0.minor}".format(sys.version_info)
28+
suffix = ["include", python_ver + sys.abiflags]
2829

2930
results = []
3031
for prefix in [sys.prefix, sys.exec_prefix]:

0 commit comments

Comments
 (0)