summaryrefslogtreecommitdiff
path: root/tests/micropython/heapalloc_iter.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/micropython/heapalloc_iter.py')
-rw-r--r--tests/micropython/heapalloc_iter.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/micropython/heapalloc_iter.py b/tests/micropython/heapalloc_iter.py
index 79461f999..163e17211 100644
--- a/tests/micropython/heapalloc_iter.py
+++ b/tests/micropython/heapalloc_iter.py
@@ -1,7 +1,8 @@
# test that iterating doesn't use the heap
try:
+ frozenset
import array
-except ImportError:
+except (NameError, ImportError):
print("SKIP")
raise SystemExit
@@ -11,8 +12,10 @@ except (ImportError, AttributeError):
heap_lock = heap_unlock = lambda:0
def do_iter(l):
+ heap_lock()
for i in l:
print(i)
+ heap_unlock()
def gen_func():
yield 1
@@ -55,7 +58,6 @@ print(sum(t))
heap_unlock()
# test iterating over collections with the heap locked
-heap_lock()
do_iter(b'123')
do_iter(ba)
do_iter(ar)
@@ -66,4 +68,3 @@ do_iter(s)
do_iter(fs)
do_iter(g1)
do_iter(g2)
-heap_unlock()