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

Function PyDict_GetItemStringRef

asyncpg/protocol/record/pythoncapi_compat.h:835–851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

833}
834
835static inline int
836PyDict_GetItemStringRef(PyObject *mp, const char *key, PyObject **result)
837{
838 int res;
839#if PY_VERSION_HEX >= 0x03000000
840 PyObject *key_obj = PyUnicode_FromString(key);
841#else
842 PyObject *key_obj = PyString_FromString(key);
843#endif
844 if (key_obj == NULL) {
845 *result = NULL;
846 return -1;
847 }
848 res = PyDict_GetItemRef(mp, key_obj, result);
849 Py_DECREF(key_obj);
850 return res;
851}
852#endif
853
854

Callers

nothing calls this directly

Calls 1

PyDict_GetItemRefFunction · 0.85

Tested by

no test coverage detected