gh-152433: Windows: improve sys.getwindowsversion(), use RtlGetVersion() and allow build for UWP#152604
gh-152433: Windows: improve sys.getwindowsversion(), use RtlGetVersion() and allow build for UWP#152604thexai wants to merge 1 commit into
Conversation
|
For more context, the actual issue with e.g: in Windows 11 25H2 return (but not directly observable because only is used as second fallback on With this change, it will be possible use In UWP, it would be the primary method because WMI is not available and Related to #129294 |
sys.getwindowsversion() use RtlGetVersion for Desktop…Version() and allow build for UWP
|
|
||
| Py_BEGIN_ALLOW_THREADS | ||
| hKernel32 = GetModuleHandleW(L"kernel32.dll"); | ||
| hMod = GetModuleHandleW(L"ntdll.dll"); |
There was a problem hiding this comment.
No thanks, we don't use ntdll from CPython.
We should be changing this function to return the version number controlled by the compatibility shims, because it will match the other compatibility behaviours that are associated with that version.
The platform module exists to get the "real" version.
There was a problem hiding this comment.
I think we went down the "read kernel32" path because this function used to be used by platform, but that module should be fully relying on WMI now, which is more accurate (if slower, but checking the version number shouldn't be a common task, and certainly not one that's used in tight loops).
Allow build for UWP.
Also fixes #146299