This commit is contained in:
Benjamin Peterson 2012-04-24 11:09:20 -04:00
commit 42f58818d6
3 changed files with 18 additions and 3 deletions

View file

@ -3035,7 +3035,7 @@ object_str(PyObject *self)
unaryfunc f;
f = Py_TYPE(self)->tp_repr;
if (f == NULL || f == object_str)
if (f == NULL)
f = object_repr;
return f(self);
}
@ -5879,7 +5879,8 @@ update_one_slot(PyTypeObject *type, slotdef *p)
}
continue;
}
if (Py_TYPE(descr) == &PyWrapperDescr_Type) {
if (Py_TYPE(descr) == &PyWrapperDescr_Type &&
((PyWrapperDescrObject *)descr)->d_base->name_strobj == p->name_strobj) {
void **tptr = resolve_slotdups(type, p->name_strobj);
if (tptr == NULL || tptr == ptr)
generic = p->function;