Commit c13cdca3 authored by Stefan Behnel's avatar Stefan Behnel

work-around for ticket #691: look up unknown global names in builtins at runtime

parent 6247adc5
...@@ -7691,11 +7691,18 @@ impl = """ ...@@ -7691,11 +7691,18 @@ impl = """
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
PyObject *result; PyObject *result;
result = PyObject_GetAttr(dict, name); result = PyObject_GetAttr(dict, name);
if (!result) if (!result) {
PyErr_SetObject(PyExc_NameError, name); if (dict != %(BUILTINS)s) {
PyErr_Clear();
result = PyObject_GetAttr(%(BUILTINS)s, name);
}
if (!result) {
PyErr_SetObject(PyExc_NameError, name);
}
}
return result; return result;
} }
""") """ % {'BUILTINS' : Naming.builtins_cname})
#------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment