circuitpython/tests/micropython/heap_lock.py

15 lines
200 B
Python

# check that heap_lock/heap_unlock work as expected
import micropython
micropython.heap_lock()
try:
print([])
except MemoryError:
print('MemoryError')
micropython.heap_unlock()
print([])