]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-105927: Limit PyWeakref_GetRef() to limited C API 3.13 (#117091)
authorVictor Stinner <vstinner@python.org>
Wed, 20 Mar 2024 22:52:23 +0000 (23:52 +0100)
committerGitHub <noreply@github.com>
Wed, 20 Mar 2024 22:52:23 +0000 (23:52 +0100)
Include/weakrefobject.h

index 727ba6934bbacbbd310c0450e716819168017c9f..a6e71eb178b124b236b0668ddda4fc27f5b64a7b 100644 (file)
@@ -28,7 +28,10 @@ PyAPI_FUNC(PyObject *) PyWeakref_NewRef(PyObject *ob,
 PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob,
                                           PyObject *callback);
 Py_DEPRECATED(3.13) PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
+
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030D0000
 PyAPI_FUNC(int) PyWeakref_GetRef(PyObject *ref, PyObject **pobj);
+#endif
 
 
 #ifndef Py_LIMITED_API