Merge pull request #2116 from vstinner/python311

Add Python 3.11 support: use Py_SET_TYPE()
This commit is contained in:
William S Fulton 2021-12-07 20:32:31 +00:00 committed by GitHub
commit 7246cfa6c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -414,7 +414,11 @@ SwigPyBuiltin_ThisClosure (PyObject *self, void *SWIGUNUSEDPARM(closure)) {
SWIGINTERN void
SwigPyBuiltin_SetMetaType (PyTypeObject *type, PyTypeObject *metatype)
{
#if PY_VERSION_HEX >= 0x030900A4
Py_SET_TYPE(type, metatype);
#else
Py_TYPE(type) = metatype;
#endif
}