@@ -6081,6 +6081,43 @@ settrace_to_record(PyObject *self, PyObject *list)
60816081}
60826082
60836083static PyObject * negative_dictoffset (PyObject * , PyObject * );
6084+
6085+ static PyObject *
6086+ function_get_code (PyObject * self , PyObject * func )
6087+ {
6088+ PyObject * code = PyFunction_GetCode (func );
6089+ if (code != NULL ) {
6090+ Py_INCREF (code );
6091+ return code ;
6092+ } else {
6093+ return NULL ;
6094+ }
6095+ }
6096+
6097+ static PyObject *
6098+ function_get_globals (PyObject * self , PyObject * func )
6099+ {
6100+ PyObject * globals = PyFunction_GetGlobals (func );
6101+ if (globals != NULL ) {
6102+ Py_INCREF (globals );
6103+ return globals ;
6104+ } else {
6105+ return NULL ;
6106+ }
6107+ }
6108+
6109+ static PyObject *
6110+ function_get_module (PyObject * self , PyObject * func )
6111+ {
6112+ PyObject * module = PyFunction_GetModule (func );
6113+ if (module != NULL ) {
6114+ Py_INCREF (module );
6115+ return module ;
6116+ } else {
6117+ return NULL ;
6118+ }
6119+ }
6120+
60846121static PyObject * test_buildvalue_issue38913 (PyObject * , PyObject * );
60856122static PyObject * getargs_s_hash_int (PyObject * , PyObject * , PyObject * );
60866123static PyObject * getargs_s_hash_int2 (PyObject * , PyObject * , PyObject * );
@@ -6382,6 +6419,9 @@ static PyMethodDef TestMethods[] = {
63826419 {"get_feature_macros" , get_feature_macros , METH_NOARGS , NULL },
63836420 {"test_code_api" , test_code_api , METH_NOARGS , NULL },
63846421 {"settrace_to_record" , settrace_to_record , METH_O , NULL },
6422+ {"function_get_code" , function_get_code , METH_O , NULL },
6423+ {"function_get_globals" , function_get_globals , METH_O , NULL },
6424+ {"function_get_module" , function_get_module , METH_O , NULL },
63856425 {NULL , NULL } /* sentinel */
63866426};
63876427
0 commit comments