From 0cec97eb6a3e31493c29ef9398fcf39a5ec445a6 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 13 Nov 2020 14:44:11 +0100 Subject: [PATCH] bpo-38823: Fix compiler warning in _ctypes on Windows (GH-23258) Explicitly cast PyExc_Exception to PyTypeObject* to fix the warning: modules\_ctypes\_ctypes.c(5748): warning C4133: '=': incompatible types - from 'PyObject *' to '_typeobject *' --- Modules/_ctypes/_ctypes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 8bb34877c53..5f8a723f637 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -5745,7 +5745,7 @@ _ctypes_add_types(PyObject *mod) TYPE_READY(&StructParam_Type); #ifdef MS_WIN32 - TYPE_READY_BASE(&PyComError_Type, PyExc_Exception); + TYPE_READY_BASE(&PyComError_Type, (PyTypeObject*)PyExc_Exception); #endif #undef TYPE_READY