summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
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 e90e0b9..587d792 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -4252,6 +4252,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):