diff Objects/typeobject.c @ 71360:cd9eca1bf531 2.7

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:22:50 +0200
parents 9618303852da
children b4ccf8e1fdba
line wrap: on
line diff
--- a/Objects/typeobject.c	Fri Jul 15 14:15:40 2011 -0500
+++ b/Objects/typeobject.c	Fri Jul 15 21:22:50 2011 +0200
@@ -2980,7 +2980,7 @@
     unaryfunc f;
 
     f = Py_TYPE(self)->tp_repr;
-    if (f == NULL)
+    if (f == NULL || f == object_str)
         f = object_repr;
     return f(self);
 }