mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 17:10:24 +08:00
34 lines
596 B
Python
34 lines
596 B
Python
# 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")
|