MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / PyErr_SetKeyError

Function PyErr_SetKeyError

include/pyshim.hh:100–108  ·  view source on GitHub ↗

* @brief Shim for `_PyErr_SetKeyError`. * Since Python 3.13, `_PyErr_SetKeyError` function became an internal API. */

Source from the content-addressed store, hash-verified

98 * Since Python 3.13, `_PyErr_SetKeyError` function became an internal API.
99 */
100inline void PyErr_SetKeyError(PyObject *key) {
101 // Use the provided API when possible, as `PyErr_SetObject`'s behaviour is more complex than originally thought
102 // see also: https://github.com/python/cpython/issues/101578
103#if PY_VERSION_HEX < 0x030d0000 // Python version is lower than 3.13
104 return _PyErr_SetKeyError(key);
105#else
106 return PyErr_SetObject(PyExc_KeyError, key);
107#endif
108}
109
110/**
111 * @brief Shim for `Py_SET_SIZE`.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected