static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
PyObject *result;
result = PyObject_GetAttr(dict, name);
- if (!result)
- PyErr_SetObject(PyExc_NameError, name);
+ if (!result) {
+ if (dict != %(BUILTINS)s) {
+ PyErr_Clear();
+ result = PyObject_GetAttr(%(BUILTINS)s, name);
+ }
+ if (!result) {
+ PyErr_SetObject(PyExc_NameError, name);
+ }
+ }
return result;
}
-""")
+""" % {'BUILTINS' : Naming.builtins_cname})
#------------------------------------------------------------------------------------