circuitpython/tests/basics/memoryerror.py
Damien George 6902eeda25 py: Add m_malloc_fail function to handle memory allocation error.
A malloc/realloc fail now throws MemoryError.
2014-04-04 10:52:59 +00:00

7 lines
118 B
Python

l = list(range(10000))
try:
100000000 * l
except MemoryError:
print('MemoryError')
print(len(l), l[0], l[-1])