Commit 80f638fe authored by Damien George's avatar Damien George
Browse files

tests: Add test for recursive iternext stack overflow.

parent 953c23b1
# 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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment