@@ -5607,6 +5607,38 @@ frame_getlasti(PyObject *self, PyObject *frame)
56075607 return PyLong_FromLong (lasti );
56085608}
56095609
5610+ static PyObject *
5611+ test_frame_getvar (PyObject * self , PyObject * args )
5612+ {
5613+ PyObject * frame , * name ;
5614+ if (!PyArg_ParseTuple (args , "OO" , & frame , & name )) {
5615+ return NULL ;
5616+ }
5617+ if (!PyFrame_Check (frame )) {
5618+ PyErr_SetString (PyExc_TypeError , "argument must be a frame" );
5619+ return NULL ;
5620+ }
5621+
5622+ return PyFrame_GetVar ((PyFrameObject * )frame , name );
5623+ }
5624+
5625+ static PyObject *
5626+ test_frame_getvarstring (PyObject * self , PyObject * args )
5627+ {
5628+ PyObject * frame ;
5629+ const char * name ;
5630+ if (!PyArg_ParseTuple (args , "Oy" , & frame , & name )) {
5631+ return NULL ;
5632+ }
5633+ if (!PyFrame_Check (frame )) {
5634+ PyErr_SetString (PyExc_TypeError , "argument must be a frame" );
5635+ return NULL ;
5636+ }
5637+
5638+ return PyFrame_GetVarString ((PyFrameObject * )frame , name );
5639+ }
5640+
5641+
56105642static PyObject *
56115643eval_get_func_name (PyObject * self , PyObject * func )
56125644{
@@ -6294,6 +6326,8 @@ static PyMethodDef TestMethods[] = {
62946326 {"frame_getgenerator" , frame_getgenerator , METH_O , NULL },
62956327 {"frame_getbuiltins" , frame_getbuiltins , METH_O , NULL },
62966328 {"frame_getlasti" , frame_getlasti , METH_O , NULL },
6329+ {"frame_getvar" , test_frame_getvar , METH_VARARGS , NULL },
6330+ {"frame_getvarstring" , test_frame_getvarstring , METH_VARARGS , NULL },
62976331 {"eval_get_func_name" , eval_get_func_name , METH_O , NULL },
62986332 {"eval_get_func_desc" , eval_get_func_desc , METH_O , NULL },
62996333 {"get_feature_macros" , get_feature_macros , METH_NOARGS , NULL },
0 commit comments