Check return result from Py_InitModule*().  This API can fail.

Probably should be backported.
diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c
index b5f30cb..c3f313a 100644
--- a/Modules/_curses_panel.c
+++ b/Modules/_curses_panel.c
@@ -462,6 +462,8 @@
 
     /* Create the module and add the functions */
     m = Py_InitModule("_curses_panel", PyCurses_methods);
+    if (m == NULL)
+    	return;
     d = PyModule_GetDict(m);
 
     /* For exception _curses_panel.error */