Commit 76b2870f authored by Boxiang Sun's avatar Boxiang Sun

If type->tp_getattr is not NULL, don't set has_getattribute to False

In Pyston, has_getattribute got set if __getattribute__ is overridden,
but only tp_getattro is supposed to set __getattribute__ and tp_getattr
will not set it. So add a check to update_one_slot, if type->tp_getattr
is not NULL, don't set has_getattribute to False.
parent e6931d60
......@@ -1929,7 +1929,7 @@ static const slotdef* update_one_slot(BoxedClass* type, const slotdef* p) noexce
static BoxedString* getattribute_str = getStaticString("__getattribute__");
if (p->name_strobj == getattribute_str) {
if (descr && descr->cls == &PyWrapperDescr_Type
if (type->tp_getattr == NULL && descr && descr->cls == &PyWrapperDescr_Type
&& ((PyWrapperDescrObject*)descr)->d_wrapped == PyObject_GenericGetAttr)
descr = NULL;
}
......
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