mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
gh-94808: Cover PyEval_GetFuncName
(#98246)
This commit is contained in:
parent
120b4ab2b6
commit
f01b56c7bd
2 changed files with 22 additions and 0 deletions
|
@ -5469,6 +5469,12 @@ frame_getlasti(PyObject *self, PyObject *frame)
|
|||
return PyLong_FromLong(lasti);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
eval_get_func_name(PyObject *self, PyObject *func)
|
||||
{
|
||||
return PyUnicode_FromString(PyEval_GetFuncName(func));
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
get_feature_macros(PyObject *self, PyObject *Py_UNUSED(args))
|
||||
{
|
||||
|
@ -5925,6 +5931,7 @@ static PyMethodDef TestMethods[] = {
|
|||
{"frame_getgenerator", frame_getgenerator, METH_O, NULL},
|
||||
{"frame_getbuiltins", frame_getbuiltins, METH_O, NULL},
|
||||
{"frame_getlasti", frame_getlasti, METH_O, NULL},
|
||||
{"eval_get_func_name", eval_get_func_name, METH_O, NULL},
|
||||
{"get_feature_macros", get_feature_macros, METH_NOARGS, NULL},
|
||||
{"test_code_api", test_code_api, METH_NOARGS, NULL},
|
||||
{"settrace_to_record", settrace_to_record, METH_O, NULL},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue