@@ -6081,6 +6081,43 @@ settrace_to_record(PyObject *self, PyObject *list)
6081
6081
}
6082
6082
6083
6083
static 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
+
6084
6121
static PyObject * test_buildvalue_issue38913 (PyObject * , PyObject * );
6085
6122
static PyObject * getargs_s_hash_int (PyObject * , PyObject * , PyObject * );
6086
6123
static PyObject * getargs_s_hash_int2 (PyObject * , PyObject * , PyObject * );
@@ -6382,6 +6419,9 @@ static PyMethodDef TestMethods[] = {
6382
6419
{"get_feature_macros" , get_feature_macros , METH_NOARGS , NULL },
6383
6420
{"test_code_api" , test_code_api , METH_NOARGS , NULL },
6384
6421
{"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 },
6385
6425
{NULL , NULL } /* sentinel */
6386
6426
};
6387
6427
0 commit comments