diff Objects/typeobject.c @ 71355:b488e027c952 3.1

Issue #11603: Fix a crash when __str__ is rebound as __repr__. Patch by Andreas Stührk.
author Antoine Pitrou <solipsis@pitrou.net>
date Fri, 15 Jul 2011 21:15:07 +0200
parents 310b484ebd91
children 8b52ac4a0c9f
line wrap: on
line diff
--- a/Objects/typeobject.c	Thu Jul 14 19:53:38 2011 +0200
+++ b/Objects/typeobject.c	Fri Jul 15 21:15:07 2011 +0200
@@ -2821,7 +2821,7 @@
     unaryfunc f;
 
     f = Py_TYPE(self)->tp_repr;
-    if (f == NULL)
+    if (f == NULL || f == object_str)
         f = object_repr;
     return f(self);
 }