Skip to content

Commit

Permalink
pythongh-106004: PyDict_GetItemRef() should only be in the limited AP…
Browse files Browse the repository at this point in the history
…I 3.13
  • Loading branch information
serhiy-storchaka committed Jul 25, 2023
1 parent f443b54 commit 4210c15
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Include/dictobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ 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 >= 0x030A0000
// 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.
// - If the key is missing, set *result to NULL and return 0 .
// - 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 *);
Expand Down

0 comments on commit 4210c15

Please sign in to comment.