diff options
author | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2022-10-15 18:48:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-15 18:48:48 (GMT) |
commit | 93d0d9cfdd74b7ff80a75ce8887adef600f21c69 (patch) | |
tree | 04abd04201867525063008e1f06e33d19f8d9a46 /Modules | |
parent | 099620b0ce964ffe85fc52a7595ece13a55ca81c (diff) | |
download | cpython-93d0d9cfdd74b7ff80a75ce8887adef600f21c69.zip cpython-93d0d9cfdd74b7ff80a75ce8887adef600f21c69.tar.gz cpython-93d0d9cfdd74b7ff80a75ce8887adef600f21c69.tar.bz2 |
[3.11] gh-94808: Cover `PyEval_GetFuncName` (GH-98246). (#98283)
(cherry picked from commit f01b56c7bdec239abe0dae2706f8325f4336249c)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Diffstat (limited to 'Modules')
-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 43fec81..69703be 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -5936,6 +5936,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(); @@ -6372,6 +6378,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}, |