Skip to content

Commit 3e4d54b

Browse files
authored
fix: match new extension discovery with changes to classic discovery (#2640)
* 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 * fix: followup to avoid warnings
1 parent 6d4854a commit 3e4d54b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tools/FindPythonLibsNew.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ print('.'.join(str(v) for v in sys.version_info));
115115
print(sys.prefix);
116116
print(s.get_python_inc(plat_specific=True));
117117
print(s.get_python_lib(plat_specific=True));
118-
print(s.get_config_var('SO') or s.get_config_var('EXT_SUFFIX'));
118+
print(s.get_config_var('EXT_SUFFIX') or s.get_config_var('SO'));
119119
print(hasattr(sys, 'gettotalrefcount')+0);
120120
print(struct.calcsize('@P'));
121121
print(s.get_config_var('LDVERSION') or s.get_config_var('VERSION'));

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('EXT_SUFFIX') or s.get_config_var('SO'))"
100101
OUTPUT_VARIABLE _PYTHON_MODULE_EXTENSION
101102
ERROR_VARIABLE _PYTHON_MODULE_EXTENSION_ERR
102103
OUTPUT_STRIP_TRAILING_WHITESPACE)

0 commit comments

Comments
 (0)