Skip to content

Commit

Permalink
Allow _wmi
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Jan 14, 2025
1 parent 5b3edf8 commit c6a4d27
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cpython-windows/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,13 @@ def hack_project_files(
rb'<ClCompile Include="$(opensslIncludeDir)\openssl\applink.c">',
)

# 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)" />',
Expand Down
6 changes: 6 additions & 0 deletions src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c6a4d27

Please sign in to comment.