Avoid using PyErr_SetFromWindowsErr on Cygwin

This commit is contained in:
Javier Dehesa 2022-11-25 22:27:18 +00:00 committed by GitHub
parent 80d7fa9004
commit 4a36d9d761
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -329,7 +329,11 @@ load_tkinter_funcs(void) {
/* Allocate module handlers array */
if (!EnumProcessModules(hProcess, NULL, 0, &cbNeeded)) {
#if defined(__CYGWIN__)
PyErr_SetString(PyExc_OSError, "Call to EnumProcessModules failed");
#else
PyErr_SetFromWindowsErr(0);
#endif
return 1;
}
if (!(hMods = (HMODULE*) malloc(cbNeeded))) {