This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Mark.Shannon, frenzy, pablogsal, vstinner
Date 2021-02-17.17:47:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1613584027.97.0.564421766111.issue43228@roundup.psfhosted.org>
In-reply-to
Content
I wrote _testinernalcapi.get_builtins() function to help me debuging this issue:

diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c
index ab6c5965d1..250ecc61ab 100644
--- a/Modules/_testinternalcapi.c
+++ b/Modules/_testinternalcapi.c
@@ -279,6 +279,14 @@ test_atomic_funcs(PyObject *self, PyObject *Py_UNUSED(args))
 }
 
 
+static PyObject*
+get_builtins(PyObject *self, PyObject *obj)
+{
+    PyFunctionObject *func = (PyFunctionObject *)obj;
+    return Py_NewRef(func->func_builtins);
+}
+
+
 static PyMethodDef TestMethods[] = {
     {"get_configs", get_configs, METH_NOARGS},
     {"get_recursion_depth", get_recursion_depth, METH_NOARGS},
@@ -289,6 +297,7 @@ static PyMethodDef TestMethods[] = {
     {"get_config", test_get_config, METH_NOARGS},
     {"set_config", test_set_config, METH_O},
     {"test_atomic_funcs", test_atomic_funcs, METH_NOARGS},
+    {"get_builtins", get_builtins, METH_O},
     {NULL, NULL} /* sentinel */
 };
History
Date User Action Args
2021-02-17 17:47:07vstinnersetrecipients: + vstinner, Mark.Shannon, frenzy, pablogsal
2021-02-17 17:47:07vstinnersetmessageid: <1613584027.97.0.564421766111.issue43228@roundup.psfhosted.org>
2021-02-17 17:47:07vstinnerlinkissue43228 messages
2021-02-17 17:47:07vstinnercreate