Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5d118d0

Browse filesBrowse files
authored
gh-133580: Add missing exception to _sys_getwindowsversion_from_kernel32 (GH-133574)
1 parent b44c824 commit 5d118d0
Copy full SHA for 5d118d0

File tree

2 files changed

+2
-0
lines changed
Filter options

2 files changed

+2
-0
lines changed
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix :func:`sys.getwindowsversion` failing without setting an exception when called on some WinAPI partitions.

‎Python/sysmodule.c

Copy file name to clipboardExpand all lines: Python/sysmodule.c
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,7 @@ static PyObject *
16431643
_sys_getwindowsversion_from_kernel32(void)
16441644
{
16451645
#ifndef MS_WINDOWS_DESKTOP
1646+
PyErr_SetString(PyExc_OSError, "cannot read version info on this platform");
16461647
return NULL;
16471648
#else
16481649
HANDLE hKernel32;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.