diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-15 19:15:07 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-15 19:15:07 (GMT) |
commit | 8cdc40e3b0622ea4eeb8b2c9b0e6796be685d16d (patch) | |
tree | b0570fc82de1c24aee5e81c8199de476179ca35f /Objects | |
parent | e22813067e4f62629a9c24947c29a55861fb05f1 (diff) | |
download | cpython-8cdc40e3b0622ea4eeb8b2c9b0e6796be685d16d.zip cpython-8cdc40e3b0622ea4eeb8b2c9b0e6796be685d16d.tar.gz cpython-8cdc40e3b0622ea4eeb8b2c9b0e6796be685d16d.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 5c20e0d..70971f3 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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); } |