Skip to content
Snippets Groups Projects
Commit b86c2067 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

tests/recursive_iternext.py: Make low-heap friendly.

parent db984b73
No related branches found
No related tags found
No related merge requests found
# This tests that recursion with iternext doesn't lead to segfault. # This tests that recursion with iternext doesn't lead to segfault.
try:
[0] * 10000
N = 1000
except:
N = 100
try: try:
x = (1, 2) x = (1, 2)
for i in range(1000): for i in range(N):
x = enumerate(x) x = enumerate(x)
tuple(x) tuple(x)
except RuntimeError: except RuntimeError:
...@@ -10,7 +16,7 @@ except RuntimeError: ...@@ -10,7 +16,7 @@ except RuntimeError:
try: try:
x = (1, 2) x = (1, 2)
for i in range(1000): for i in range(N):
x = filter(None, x) x = filter(None, x)
tuple(x) tuple(x)
except RuntimeError: except RuntimeError:
...@@ -18,7 +24,7 @@ except RuntimeError: ...@@ -18,7 +24,7 @@ except RuntimeError:
try: try:
x = (1, 2) x = (1, 2)
for i in range(1000): for i in range(N):
x = map(max, x, ()) x = map(max, x, ())
tuple(x) tuple(x)
except RuntimeError: except RuntimeError:
...@@ -26,7 +32,7 @@ except RuntimeError: ...@@ -26,7 +32,7 @@ except RuntimeError:
try: try:
x = (1, 2) x = (1, 2)
for i in range(1000): for i in range(N):
x = zip(x) x = zip(x)
tuple(x) tuple(x)
except RuntimeError: except RuntimeError:
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment