Skip to content
Snippets Groups Projects
Commit 80f638fe authored by Damien George's avatar Damien George
Browse files

tests: Add test for recursive iternext stack overflow.

parent 953c23b1
Branches
No related tags found
No related merge requests found
# This tests that recursion with iternext doesn't lead to segfault.
try:
x = (1, 2)
for i in range(1000):
x = enumerate(x)
tuple(x)
except RuntimeError:
print("RuntimeError")
try:
x = (1, 2)
for i in range(1000):
x = filter(None, x)
tuple(x)
except RuntimeError:
print("RuntimeError")
try:
x = (1, 2)
for i in range(1000):
x = map(max, x, ())
tuple(x)
except RuntimeError:
print("RuntimeError")
try:
x = (1, 2)
for i in range(1000):
x = zip(x)
tuple(x)
except RuntimeError:
print("RuntimeError")
RuntimeError
RuntimeError
RuntimeError
RuntimeError
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment