diff Python/pystate.c @ 40012:ab13576374b1 2.4

[Backport r50743 | neal.norwitz] Handle allocation failures gracefully. Found with failmalloc. Many (all?) of these could be backported.
author Andrew M. Kuchling <amk@amk.ca>
date Thu, 05 Oct 2006 18:08:58 +0000
parents 7d0f12340c9e
children
line wrap: on
line diff
--- a/Python/pystate.c	Thu Oct 05 17:30:48 2006 +0000
+++ b/Python/pystate.c	Thu Oct 05 18:08:58 2006 +0000
@@ -66,6 +66,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;