diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-15 19:18:18 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-15 19:18:18 (GMT) |
commit | 9b43b6e14e65b6086d0d3227cfd600d4bbb38cc2 (patch) | |
tree | 43e635e7aee927dd58a9496d822b7de8e778a15d /Objects | |
parent | 874d65afaef54993eb5779c31611f5f3baa995e2 (diff) | |
parent | ff35050493edd0c738ab69f14ee2fb5db11bb5ec (diff) | |
download | cpython-9b43b6e14e65b6086d0d3227cfd600d4bbb38cc2.zip cpython-9b43b6e14e65b6086d0d3227cfd600d4bbb38cc2.tar.gz cpython-9b43b6e14e65b6086d0d3227cfd600d4bbb38cc2.tar.bz2 |
Issue #11603: Fix a crash when __str__ is rebound as __repr__.
Patch by Andreas Stührk.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 1642dad..d80b594 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2968,7 +2968,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); } |