Skip to content

Commit 2b1a81e

Browse files
gh-106004: PyDict_GetItemRef() should only be in the limited API 3.13 (GH-107229)
1 parent 6a43cce commit 2b1a81e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Include/dictobject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,15 @@ PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, const char *key);
5858
PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item);
5959
PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key);
6060

61+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030D0000
6162
// Return the object from dictionary *op* which has a key *key*.
6263
// - If the key is present, set *result to a new strong reference to the value
6364
// and return 1.
6465
// - If the key is missing, set *result to NULL and return 0 .
6566
// - On error, raise an exception and return -1.
6667
PyAPI_FUNC(int) PyDict_GetItemRef(PyObject *mp, PyObject *key, PyObject **result);
6768
PyAPI_FUNC(int) PyDict_GetItemStringRef(PyObject *mp, const char *key, PyObject **result);
69+
#endif
6870

6971
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
7072
PyAPI_FUNC(PyObject *) PyObject_GenericGetDict(PyObject *, void *);

0 commit comments

Comments
 (0)