[Python-checkins] bpo-38823: Fix compiler warning in _ctypes on Windows (GH-23258)

vstinner webhook-mailer at python.org
Fri Nov 13 08:44:18 EST 2020


https://github.com/python/cpython/commit/0cec97eb6a3e31493c29ef9398fcf39a5ec445a6
commit: 0cec97eb6a3e31493c29ef9398fcf39a5ec445a6
branch: master
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2020-11-13T14:44:11+01:00
summary:

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 *'

files:
M Modules/_ctypes/_ctypes.c

diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 8bb34877c5390..5f8a723f6373a 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



More information about the Python-checkins mailing list