Skip to content

Commit cb077b3

Browse files
maxbachmanntaegyunkim
authored andcommitted
pythongh-133580: Add missing exception to _sys_getwindowsversion_from_kernel32 (pythonGH-133574)
1 parent f58dde2 commit cb077b3

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

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)