Add stack overflow checking to Python

This commit is contained in:
Justine Tunney 2021-10-02 10:31:24 -07:00
parent 47a53e143b
commit 7521bf9e73
16 changed files with 47 additions and 46 deletions

View file

@ -219,7 +219,12 @@ class DictSetTest(unittest.TestCase):
d = {}
for i in range(sys.getrecursionlimit() + 100):
d = {42: d.values()}
self.assertRaises(RecursionError, repr, d)
try:
repr(d)
except (RecursionError, MemoryError):
pass
else:
assert False
def test_copy(self):
d = {1: 10, "a": "ABC"}