summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-07-15 21:19:27 +0200
committerAntoine Pitrou <solipsis@pitrou.net>2011-07-15 21:19:27 +0200
commit91fe8157fd3518fcf7c2f7cd7bd247131e8e839f (patch)
treeed19f5dfb61e1653213cc3f2cfb97d07fcf1455f /Lib/test
parent2ca3ffb0989e53f8ae70f7177e97f43ac1d1af98 (diff)
parent9b43b6e14e65b6086d0d3227cfd600d4bbb38cc2 (diff)
downloadcpython-git-91fe8157fd3518fcf7c2f7cd7bd247131e8e839f.tar.gz
Merge
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_descr.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 0fae2dfe9f..4a02ec178e 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -4247,6 +4247,14 @@ order (MRO) for bases """
with self.assertRaises(TypeError):
str.__add__(fake_str, "abc")
+ def test_repr_as_str(self):
+ # Issue #11603: crash or infinite loop when rebinding __str__ as
+ # __repr__.
+ class Foo:
+ pass
+ Foo.__repr__ = Foo.__str__
+ foo = Foo()
+ str(foo)
class DictProxyTests(unittest.TestCase):
def setUp(self):