diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-10-15 15:20:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-15 15:20:39 (GMT) |
commit | f01b56c7bdec239abe0dae2706f8325f4336249c (patch) | |
tree | 7f0169c840ec31dde39e5fb5e201e3f3c86d0589 /Modules/_testcapimodule.c | |
parent | 120b4ab2b68aebf96ce0de243eab89a25fc2d282 (diff) | |
download | cpython-f01b56c7bdec239abe0dae2706f8325f4336249c.zip cpython-f01b56c7bdec239abe0dae2706f8325f4336249c.tar.gz cpython-f01b56c7bdec239abe0dae2706f8325f4336249c.tar.bz2 |
gh-94808: Cover `PyEval_GetFuncName` (#98246)
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r-- | Modules/_testcapimodule.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 95c67fc..76e619d 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -5470,6 +5470,12 @@ frame_getlasti(PyObject *self, PyObject *frame) } 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)) { PyObject *result = PyDict_New(); @@ -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}, |