diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2021-12-07 20:32:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-07 20:32:31 +0000 |
commit | 7246cfa6c6e1877cd679a23970da477cad039a28 (patch) | |
tree | b63f03a0802f5af73fa2572c6e7c804f9438eba2 | |
parent | e0935404a8bb7dae1c984149448ce655a030123e (diff) | |
parent | e902ab516087ef512ea9b3e06564cb246edcc50d (diff) | |
download | swig-7246cfa6c6e1877cd679a23970da477cad039a28.tar.gz |
Merge pull request #2116 from vstinner/python311
Add Python 3.11 support: use Py_SET_TYPE()
-rw-r--r-- | Lib/python/builtin.swg | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/python/builtin.swg b/Lib/python/builtin.swg index 4f31a8d54..ec092233d 100644 --- a/Lib/python/builtin.swg +++ b/Lib/python/builtin.swg @@ -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 } |