Issue #11603: Fix a crash when __str__ is rebound as __repr__.

Patch by Andreas Stührk.
This commit is contained in:
Antoine Pitrou 2011-07-15 21:17:14 +02:00
commit ff35050493
3 changed files with 12 additions and 1 deletions

View file

@ -2890,7 +2890,7 @@ object_str(PyObject *self)
unaryfunc f;
f = Py_TYPE(self)->tp_repr;
if (f == NULL)
if (f == NULL || f == object_str)
f = object_repr;
return f(self);
}