2015-06-03 22:41:06 +01:00
|
|
|
# This tests that recursion with iternext doesn't lead to segfault.
|
|
|
|
|
2016-02-13 13:50:22 +00:00
|
|
|
try:
|
|
|
|
[0] * 10000
|
2016-06-03 09:33:57 +01:00
|
|
|
N = 2000
|
2016-02-13 13:50:22 +00:00
|
|
|
except:
|
|
|
|
N = 100
|
|
|
|
|
2015-06-03 22:41:06 +01:00
|
|
|
try:
|
|
|
|
x = (1, 2)
|
2016-02-13 13:50:22 +00:00
|
|
|
for i in range(N):
|
2015-06-03 22:41:06 +01:00
|
|
|
x = enumerate(x)
|
|
|
|
tuple(x)
|
|
|
|
except RuntimeError:
|
|
|
|
print("RuntimeError")
|
|
|
|
|
|
|
|
try:
|
|
|
|
x = (1, 2)
|
2016-02-13 13:50:22 +00:00
|
|
|
for i in range(N):
|
2015-06-03 22:41:06 +01:00
|
|
|
x = filter(None, x)
|
|
|
|
tuple(x)
|
|
|
|
except RuntimeError:
|
|
|
|
print("RuntimeError")
|
|
|
|
|
|
|
|
try:
|
|
|
|
x = (1, 2)
|
2016-02-13 13:50:22 +00:00
|
|
|
for i in range(N):
|
2015-06-03 22:41:06 +01:00
|
|
|
x = map(max, x, ())
|
|
|
|
tuple(x)
|
|
|
|
except RuntimeError:
|
|
|
|
print("RuntimeError")
|
|
|
|
|
|
|
|
try:
|
|
|
|
x = (1, 2)
|
2016-02-13 13:50:22 +00:00
|
|
|
for i in range(N):
|
2015-06-03 22:41:06 +01:00
|
|
|
x = zip(x)
|
|
|
|
tuple(x)
|
|
|
|
except RuntimeError:
|
|
|
|
print("RuntimeError")
|