]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38823: Fix compiler warning in _ctypes on Windows (GH-23258)
authorVictor Stinner <vstinner@python.org>
Fri, 13 Nov 2020 13:44:11 +0000 (14:44 +0100)
committerGitHub <noreply@github.com>
Fri, 13 Nov 2020 13:44:11 +0000 (14:44 +0100)
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

index 8bb34877c539039159ed759e571e10c68054a50e..5f8a723f6373ae2ef618cfd3d1e0c5d1bdbcdca9 100644 (file)
@@ -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