Skip to content

Commit

Permalink
bpo-38823: Fix compiler warning in _ctypes on Windows (pythonGH-23258)
Browse files Browse the repository at this point in the history
Explicitly cast PyExc_Exception to PyTypeObject* to fix the warning:

    modules\_ctypes\_ctypes.c(5748): warning C4133: '=':
    incompatible types - from 'PyObject *' to '_typeobject *'
  • Loading branch information
vstinner authored and adorilson committed Mar 11, 2021
1 parent 0e5c9d5 commit 15767b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 15767b2

Please sign in to comment.