mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Fix a possible segfault from recursing too deep to get the repr of a list.
Closes issue #1096.
This commit is contained in:
parent
f3d280e62a
commit
a0c05512ec
3 changed files with 11 additions and 0 deletions
|
@ -46,6 +46,11 @@ class CommonTest(seq_tests.CommonTest):
|
|||
self.assertEqual(str(a2), "[0, 1, 2, [...], 3]")
|
||||
self.assertEqual(repr(a2), "[0, 1, 2, [...], 3]")
|
||||
|
||||
l0 = []
|
||||
for i in xrange(sys.getrecursionlimit() + 100):
|
||||
l0 = [l0]
|
||||
self.assertRaises(RuntimeError, repr, l0)
|
||||
|
||||
def test_print(self):
|
||||
d = self.type2test(xrange(200))
|
||||
d.append(d)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue