From c6a4d27864356e8ae1098c2c60bfad2cba96cca5 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 14 Jan 2025 14:38:54 -0600 Subject: [PATCH] Allow `_wmi` --- cpython-windows/build.py | 11 +++++++---- src/validation.rs | 6 ++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index bb40578d..638a2c78 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -573,10 +573,13 @@ def hack_project_files( rb'', ) - # We're still on the pre-built tk-windows-bin 8.6.12 which doesn't have a - # standalone zlib DLL. So remove references to it from 3.12+. - # On 3.14, something changed - if meets_python_minimum_version(python_version, "3.12") and meets_python_maximum_version(python_version, "3.13"): + # Python 3.12+ uses the the pre-built tk-windows-bin 8.6.12 which doesn't + # have a standalone zlib DLL, so we remove references to it. For Python + # 3.14+, we're using tk-windows-bin 8.6.14 which includes a prebuilt zlib + # DLL, so we skip this patch there. + if meets_python_minimum_version( + python_version, "3.12" + ) and meets_python_maximum_version(python_version, "3.13"): static_replace_in_file( pcbuild_path / "_tkinter.vcxproj", rb'<_TclTkDLL Include="$(tcltkdir)\bin\$(tclZlibDllName)" />', diff --git a/src/validation.rs b/src/validation.rs index 3d5ce256..1beea181 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -798,6 +798,8 @@ const GLOBAL_EXTENSIONS_WINDOWS: &[&str] = &[ "winsound", ]; +const GLOBAL_EXTENSIONS_WINDOWS_3_14: &[&str] = &["_wmi"]; + const GLOBAL_EXTENSIONS_WINDOWS_PRE_3_13: &[&str] = &["_msi"]; /// Extension modules not present in Windows static builds. @@ -1542,6 +1544,10 @@ fn validate_extension_modules( wanted.extend(GLOBAL_EXTENSIONS_WINDOWS_PRE_3_13); } + if matches!(python_major_minor, "3.14") { + wanted.extend(GLOBAL_EXTENSIONS_WINDOWS_3_14); + } + if static_crt { for x in GLOBAL_EXTENSIONS_WINDOWS_NO_STATIC { wanted.remove(*x);