summaryrefslogtreecommitdiff
path: root/tests/micropython/heapalloc_fail_tuple.py
blob: 1cd23fb74bce38976fb469f5e17c06b2aff31192 (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()