summaryrefslogtreecommitdiff
path: root/tests/micropython/heapalloc_fail_tuple.py
blob: de79385e3e3cb6590ad358a08210923fe1784089 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# test handling of failed heap allocation with tuple

import micropython

# create tuple
x = 1
micropython.heap_lock()
try:
    (x,)
except MemoryError:
    print("MemoryError: tuple create")
micropython.heap_unlock()