summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-07-15 19:22:50 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-07-15 19:22:50 (GMT)
commit304f0f952da3c2f1d354b1701aa5ad61b53ff179 (patch)
tree1490aabd08b8e3c44dac02824a959c32bd6ab064 /Objects
parentc3349cd22e9877a0516d8baa71530f87bf5ac430 (diff)
downloadcpython-304f0f952da3c2f1d354b1701aa5ad61b53ff179.zip
cpython-304f0f952da3c2f1d354b1701aa5ad61b53ff179.tar.gz
cpython-304f0f952da3c2f1d354b1701aa5ad61b53ff179.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 8326d07..3864b48 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2980,7 +2980,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);
}