| 188 | // bpo-40421 added PyFrame_GetLocals() to Python 3.11.0a7 |
| 189 | #if PY_VERSION_HEX < 0x030B00A7 && !defined(PYPY_VERSION) |
| 190 | static inline PyObject* PyFrame_GetLocals(PyFrameObject *frame) |
| 191 | { |
| 192 | #if PY_VERSION_HEX >= 0x030400B1 |
| 193 | if (PyFrame_FastToLocalsWithError(frame) < 0) { |
| 194 | return NULL; |
| 195 | } |
| 196 | #else |
| 197 | PyFrame_FastToLocals(frame); |
| 198 | #endif |
| 199 | return Py_NewRef(frame->f_locals); |
| 200 | } |
| 201 | #endif |
| 202 | |
| 203 |