diff Modules/bz2module.c @ 48201:d615aa9fdf36 legacy-trunk

#3205: bz2 iterator fails silently on MemoryError
author Antoine Pitrou <solipsis@pitrou.net>
date Sat, 09 Aug 2008 17:22:25 +0000
parents 30fbf8e45549
children b8c4bf393794
line wrap: on
line diff
--- a/Modules/bz2module.c	Sat Aug 09 14:55:34 2008 +0000
+++ b/Modules/bz2module.c	Sat Aug 09 17:22:25 2008 +0000
@@ -416,6 +416,7 @@
 		return 0;
 	}
 	if ((f->f_buf = PyMem_Malloc(bufsize)) == NULL) {
+		PyErr_NoMemory();
 		return -1;
 	}
 	Py_BEGIN_ALLOW_THREADS