Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Py_SET_SIZE() to support Python 3.11
* Replace "Py_TYPE(obj) = type" with "Py_SET_TYPE(obj, type)" * Replace "Py_SIZE(obj) = size" with "Py_SET_SIZE(obj, size)" * Replace "Py_REFCNT(obj) = refcnt" with "Py_SET_REFCNT(obj, refcnt)" * Add pythoncapi_compat.h to get these functions on Python 3.8 and older. File copied from: https://github.com/pythoncapi/pythoncapi_compat On Python 3.10, Py_REFCNT() can no longer be used as an l-value to set a reference count: * https://docs.python.org/dev/c-api/structures.html#c.Py_REFCNT * https://docs.python.org/dev/whatsnew/3.10.html#id2 On Python 3.11, Py_TYPE() and Py_SIZE() can no longer as l-values be used to set an object type and size: * https://docs.python.org/dev/c-api/structures.html#c.Py_TYPE * https://docs.python.org/dev/c-api/structures.html#c.Py_SIZE * https://docs.python.org/dev/whatsnew/3.11.html#id2
- Loading branch information