| 813 | // to Python 3.13.0a1 |
| 814 | #if PY_VERSION_HEX < 0x030D00A1 |
| 815 | static inline int |
| 816 | PyDict_GetItemRef(PyObject *mp, PyObject *key, PyObject **result) |
| 817 | { |
| 818 | #if PY_VERSION_HEX >= 0x03000000 |
| 819 | PyObject *item = PyDict_GetItemWithError(mp, key); |
| 820 | #else |
| 821 | PyObject *item = _PyDict_GetItemWithError(mp, key); |
| 822 | #endif |
| 823 | if (item != NULL) { |
| 824 | *result = Py_NewRef(item); |
| 825 | return 1; // found |
| 826 | } |
| 827 | if (!PyErr_Occurred()) { |
| 828 | *result = NULL; |
| 829 | return 0; // not found |
| 830 | } |
| 831 | *result = NULL; |
| 832 | return -1; |
| 833 | } |
| 834 | |
| 835 | static inline int |
| 836 | PyDict_GetItemStringRef(PyObject *mp, const char *key, PyObject **result) |
no outgoing calls
no test coverage detected