gh-94808: Cover PyEval_GetFuncName (#98246)

This commit is contained in:
Nikita Sobolev 2022-10-15 18:20:39 +03:00 committed by GitHub
parent 120b4ab2b6
commit f01b56c7bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -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},