[3.14] gh-140153: Fix Py_REFCNT() definition on limited C API 3.11-3.13 (GH-140158) (#140164)

gh-140153: Fix Py_REFCNT() definition on limited C API 3.11-3.13 (GH-140158)
(cherry picked from commit 728d239e57)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2025-10-15 17:02:03 +02:00 committed by GitHub
parent 045e34964a
commit 95c03d018d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -117,6 +117,8 @@ PyAPI_FUNC(Py_ssize_t) Py_REFCNT(PyObject *ob);
}
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
# define Py_REFCNT(ob) _Py_REFCNT(_PyObject_CAST(ob))
#else
# define Py_REFCNT(ob) _Py_REFCNT(ob)
#endif
#endif

View file

@ -0,0 +1,2 @@
Fix :c:func:`Py_REFCNT` definition on limited C API 3.11-3.13. Patch by
Victor Stinner.