mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 05:00:26 +01:00
py: Add m_malloc_fail function to handle memory allocation error.
A malloc/realloc fail now throws MemoryError.
This commit is contained in:
6
tests/basics/memoryerror.py
Normal file
6
tests/basics/memoryerror.py
Normal file
@@ -0,0 +1,6 @@
|
||||
l = list(range(10000))
|
||||
try:
|
||||
100000000 * l
|
||||
except MemoryError:
|
||||
print('MemoryError')
|
||||
print(len(l), l[0], l[-1])
|
||||
Reference in New Issue
Block a user