8000 gh-133580: Add missing exception to _sys_getwindowsversion_from_kerne… · python/cpython@5d118d0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d118d0

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

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Lines 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

Lines 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