]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-140153: Fix Py_REFCNT() definition on limited C API 3.11-3.13 (#140158)
authorVictor Stinner <vstinner@python.org>
Wed, 15 Oct 2025 14:36:49 +0000 (16:36 +0200)
committerGitHub <noreply@github.com>
Wed, 15 Oct 2025 14:36:49 +0000 (16:36 +0200)
Include/refcount.h
Misc/NEWS.d/next/C_API/2025-10-15-15-59-59.gh-issue-140153.BO7sH4.rst [new file with mode: 0644]

index ba34461fefcbb08341654b5b6006e743acccb642..51346c7e519321dc2108d7c8bdd99a3d7af3aa5a 100644 (file)
@@ -114,6 +114,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
 
diff --git a/Misc/NEWS.d/next/C_API/2025-10-15-15-59-59.gh-issue-140153.BO7sH4.rst b/Misc/NEWS.d/next/C_API/2025-10-15-15-59-59.gh-issue-140153.BO7sH4.rst
new file mode 100644 (file)
index 0000000..502c48b
--- /dev/null
@@ -0,0 +1,2 @@
+Fix :c:func:`Py_REFCNT` definition on limited C API 3.11-3.13. Patch by
+Victor Stinner.