[3.13] gh-146092: Handle _PyFrame_GetFrameObject() failures properly (GH-146124) (GH-146132) by miss-islington · Pull Request #146138 · python/cpython
PyObject *tb = _PyTraceBack_FromFrame(NULL, f); if (tb == NULL) { return -1; } PyException_SetTraceback(wrapped, tb); Py_DECREF(tb); *match = wrapped; } *rest = Py_NewRef(Py_None);
if (PyFrameLocalsProxy_Check(locals)) { PyFrameObject *f = _PyFrame_GetFrameObject(current_frame); if (f == NULL) { Py_DECREF(locals); return NULL; }
PyObject *ret = f->f_locals_cache; if (ret == NULL) { ret = PyDict_New();