]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106004: PyDict_GetItemRef() should only be in the limited API 3.13 (GH-107229)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 25 Jul 2023 18:48:07 +0000 (21:48 +0300)
committerGitHub <noreply@github.com>
Tue, 25 Jul 2023 18:48:07 +0000 (21:48 +0300)
Include/dictobject.h

index 26434e49f91409a9b45df88e9f7db003d53c38c2..1bbeec1ab699e7581d592bce151186582b6c3c82 100644 (file)
@@ -58,6 +58,7 @@ PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, const char *key);
 PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item);
 PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key);
 
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030D0000
 // Return the object from dictionary *op* which has a key *key*.
 // - If the key is present, set *result to a new strong reference to the value
 //   and return 1.
@@ -65,6 +66,7 @@ PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key);
 // - On error, raise an exception and return -1.
 PyAPI_FUNC(int) PyDict_GetItemRef(PyObject *mp, PyObject *key, PyObject **result);
 PyAPI_FUNC(int) PyDict_GetItemStringRef(PyObject *mp, const char *key, PyObject **result);
+#endif
 
 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
 PyAPI_FUNC(PyObject *) PyObject_GenericGetDict(PyObject *, void *);