STINNER Victor added the comment: This issue is maybe a new usecase of the PEP 445.
Try attached Python module fatalmalloc.c, use attached setup.py script to build it. $ python3.4 -c 'import fatalmalloc; x="x"*(50*1024*1024); print(len(x))' Traceback (most recent call last): File "<string>", line 1, in <module> MemoryError $ python3.4 -c 'import fatalmalloc; fatalmalloc.enable(); x="x"*(50*1024*1024)' $ echo $? 1 ---------- Added file: http://bugs.python.org/file32041/fatalmalloc.c _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16381> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com