py: Add m_malloc_fail function to handle memory allocation error.

A malloc/realloc fail now throws MemoryError.
This commit is contained in:
Damien George
2014-04-04 10:52:59 +00:00
parent 072cf022e0
commit 6902eeda25
7 changed files with 20 additions and 6 deletions

View File

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