From 4d5fcca273b24a5566f1507758e5aae60cdf8a98 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 8 Nov 2022 17:40:27 +0100 Subject: gh-91248: Add PyFrame_GetVar() function (#95712) Add PyFrame_GetVar() and PyFrame_GetVarString() functions to get a frame variable by its name. Move PyFrameObject C API tests from test_capi to test_frame. --- Include/cpython/pyframe.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Include/cpython') diff --git a/Include/cpython/pyframe.h b/Include/cpython/pyframe.h index 1dc634ccee..6ec292718a 100644 --- a/Include/cpython/pyframe.h +++ b/Include/cpython/pyframe.h @@ -14,4 +14,5 @@ PyAPI_FUNC(PyObject *) PyFrame_GetBuiltins(PyFrameObject *frame); PyAPI_FUNC(PyObject *) PyFrame_GetGenerator(PyFrameObject *frame); PyAPI_FUNC(int) PyFrame_GetLasti(PyFrameObject *frame); - +PyAPI_FUNC(PyObject*) PyFrame_GetVar(PyFrameObject *frame, PyObject *name); +PyAPI_FUNC(PyObject*) PyFrame_GetVarString(PyFrameObject *frame, const char *name); -- cgit v1.2.1