diff Python/pystate.c @ 39129:f2031f15d99d legacy-trunk

Handle allocation failures gracefully. Found with failmalloc. Many (all?) of these could be backported.
author Neal Norwitz <nnorwitz@gmail.com>
date Fri, 21 Jul 2006 05:32:28 +0000
parents 85b23965ec4c
children de9e1a5dca93
line wrap: on
line diff
--- a/Python/pystate.c	Fri Jul 21 05:31:02 2006 +0000
+++ b/Python/pystate.c	Fri Jul 21 05:32:28 2006 +0000
@@ -63,6 +63,10 @@
 
 	if (interp != NULL) {
 		HEAD_INIT();
+#ifdef WITH_THREAD
+		if (head_mutex == NULL)
+			Py_FatalError("Can't initialize threads for interpreter");
+#endif
 		interp->modules = NULL;
 		interp->sysdict = NULL;
 		interp->builtins = NULL;