| 274 | // gh-91248 added PyFrame_GetVarString() to Python 3.12.0a2 |
| 275 | #if PY_VERSION_HEX < 0x030C00A2 && !defined(PYPY_VERSION) |
| 276 | static inline PyObject* |
| 277 | PyFrame_GetVarString(PyFrameObject *frame, const char *name) |
| 278 | { |
| 279 | PyObject *name_obj, *value; |
| 280 | #if PY_VERSION_HEX >= 0x03000000 |
| 281 | name_obj = PyUnicode_FromString(name); |
| 282 | #else |
| 283 | name_obj = PyString_FromString(name); |
| 284 | #endif |
| 285 | if (name_obj == NULL) { |
| 286 | return NULL; |
| 287 | } |
| 288 | value = PyFrame_GetVar(frame, name_obj); |
| 289 | Py_DECREF(name_obj); |
| 290 | return value; |
| 291 | } |
| 292 | #endif |
| 293 | |
| 294 |
nothing calls this directly
no test coverage detected