mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #11603: Fix a crash when __str__ is rebound as __repr__.
Patch by Andreas Stührk.
This commit is contained in:
parent
e22813067e
commit
8cdc40e3b0
3 changed files with 12 additions and 1 deletions
|
@ -2821,7 +2821,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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue