diff Modules/itertoolsmodule.c @ 39893:6fb46e87d5f9 2.4

[Backport of rev. 42093 by neal.norwitz] Check return result from Py_InitModule*(). This API can fail. Probably should be backported.
author Andrew M. Kuchling <amk@amk.ca>
date Wed, 27 Sep 2006 19:17:32 +0000
parents 97c97194e64b
children 2f238a2cd189
line wrap: on
line diff
--- a/Modules/itertoolsmodule.c	Wed Sep 27 19:04:53 2006 +0000
+++ b/Modules/itertoolsmodule.c	Wed Sep 27 19:17:32 2006 +0000
@@ -2454,6 +2454,8 @@
 
 	teedataobject_type.ob_type = &PyType_Type;
 	m = Py_InitModule3("itertools", module_methods, module_doc);
+	if (m == NULL)
+		return;
 
 	for (i=0 ; typelist[i] != NULL ; i++) {
 		if (PyType_Ready(typelist[i]) < 0)