summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_isinstance.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_isinstance.py b/Lib/test/test_isinstance.py
index 91e79c2..109c3f8 100644
--- a/Lib/test/test_isinstance.py
+++ b/Lib/test/test_isinstance.py
@@ -303,6 +303,16 @@ class TestIsInstanceIsSubclass(unittest.TestCase):
self.assertEqual(True, issubclass(B(), int))
+ def test_infinite_recursion_in_bases(self):
+ class X:
+ @property
+ def __bases__(self):
+ return self.__bases__
+
+ self.assertRaises(RecursionError, issubclass, X(), int)
+ self.assertRaises(RecursionError, issubclass, int, X())
+ self.assertRaises(RecursionError, isinstance, 1, X())
+
def blowstack(fxn, arg, compare_to):
# Make sure that calling isinstance with a deeply nested tuple for its