bpo-40421: Add PyFrame_GetBack() function (GH-19765)
New PyFrame_GetBack() function: get the frame next outer frame.
Replace frame->f_back with PyFrame_GetBack(frame) in most code but
frameobject.c, ceval.c and genobject.c.
diff --git a/Include/cpython/frameobject.h b/Include/cpython/frameobject.h
index e32efac..36a51ba 100644
--- a/Include/cpython/frameobject.h
+++ b/Include/cpython/frameobject.h
@@ -77,6 +77,8 @@
PyAPI_FUNC(void) _PyFrame_DebugMallocStats(FILE *out);
+PyAPI_FUNC(PyFrameObject *) PyFrame_GetBack(PyFrameObject *frame);
+
#ifdef __cplusplus
}
#endif