diff -rupN --no-dereference Python-3.10.9/Python/sysmodule.c Python-3.10.9-new/Python/sysmodule.c --- Python-3.10.9/Python/sysmodule.c 2022-12-06 19:31:21.000000000 +0100 +++ Python-3.10.9-new/Python/sysmodule.c 2022-12-08 09:36:55.987024786 +0100 @@ -39,7 +39,7 @@ Data members: #include <windows.h> #endif /* MS_WINDOWS */ -#ifdef MS_COREDLL +#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) extern void *PyWin_DLLhModule; /* A string loaded from the DLL at startup: */ extern const char *PyWin_DLLVersionString; @@ -2847,7 +2847,7 @@ _PySys_InitCore(PyThreadState *tstate, P SET_SYS_FROM_STRING("byteorder", "little"); #endif -#ifdef MS_COREDLL +#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED) SET_SYS("dllhandle", PyLong_FromVoidPtr(PyWin_DLLhModule)); SET_SYS_FROM_STRING("winver", PyWin_DLLVersionString); #endif