MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / PyMapping_GetOptionalItem

Function PyMapping_GetOptionalItem

asyncpg/protocol/record/pythoncapi_compat.h:732–744  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730// PyMapping_GetOptionalItemString() to Python 3.13.0a1
731#if PY_VERSION_HEX < 0x030D00A1
732static inline int
733PyMapping_GetOptionalItem(PyObject *obj, PyObject *key, PyObject **result)
734{
735 *result = PyObject_GetItem(obj, key);
736 if (*result) {
737 return 1;
738 }
739 if (!PyErr_ExceptionMatches(PyExc_KeyError)) {
740 return -1;
741 }
742 PyErr_Clear();
743 return 0;
744}
745
746static inline int
747PyMapping_GetOptionalItemString(PyObject *obj, const char *key, PyObject **result)

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected