Skip to content

Commit 76ba919

Browse files
committed
fix: match new extension discovery with changes to classic discovery
Followup to #2638 - this was fixed in 2.6.0, but only for classic Python
1 parent 6cc233c commit 76ba919

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/pybind11NewTools.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@ endif()
9595
# required for PyPy3 (as of 7.3.1)
9696
if(NOT DEFINED PYTHON_MODULE_EXTENSION)
9797
execute_process(
98-
COMMAND "${${_Python}_EXECUTABLE}" "-c"
99-
"from distutils import sysconfig; print(sysconfig.get_config_var('SO'))"
98+
COMMAND
99+
"${${_Python}_EXECUTABLE}" "-c"
100+
"from distutils import sysconfig as s;print(s.get_config_var('SO') or s.get_config_var('EXT_SUFFIX')"
100101
OUTPUT_VARIABLE _PYTHON_MODULE_EXTENSION
101102
ERROR_VARIABLE _PYTHON_MODULE_EXTENSION_ERR
102103
OUTPUT_STRIP_TRAILING_WHITESPACE)

0 commit comments

Comments
 (0)