[Python-checkins] r52017 - in python/branches/release24-maint: Misc/NEWS Modules/_bsddb.c Modules/_curses_panel.c Modules/_cursesmodule.c Modules/_heapqmodule.c Modules/_localemodule.c Modules/_randommodule.c Modules/_sre.c Modules/_ssl.c Modules/_testcapimodule.c Modules/_tkinter.c Modules/almodule.c Modules/arraymodule.c Modules/audioop.c Modules/binascii.c Modules/bsddbmodule.c Modules/bz2module.c Modules/cPickle.c Modules/cStringIO.c Modules/cdmodule.c Modules/clmodule.c Modules/cmathmodule.c Modules/collectionsmodule.c Modules/datetimemodule.c Modules/dbmmodule.c Modules/dlmodule.c Modules/errnomodule.c Modules/fcntlmodule.c Modules/flmodule.c Modules/fmmodule.c Modules/fpectlmodule.c Modules/fpetestmodule.c Modules/gcmodule.c Modules/gdbmmodule.c Modules/grpmodule.c Modules/imageop.c Modules/imgfile.c Modules/itertoolsmodule.c Modules/linuxaudiodev.c Modules/mathmodule.c Modules/md5module.c Modules/mmapmodule.c Modules/nismodule.c Modules/operator.c Modules/ossaudiodev.c Modules/parsermodule.c Modules/posixmodule.c Modules/puremodule.c Modules/pwdmodule.c Modules/pyexpat.c Modules/readline.c Modules/regexmodule.c Modules/resource.c Modules/rgbimgmodule.c Modules/selectmodule.c Modules/shamodule.c Modules/signalmodule.c Modules/socketmodule.c Modules/stropmodule.c Modules/structmodule.c Modules/sunaudiodev.c Modules/svmodule.c Modules/symtablemodule.c Modules/syslogmodule.c Modules/termios.c Modules/threadmodule.c Modules/timemodule.c Modules/xxmodule.c PC/_subprocess.c PC/_winreg.c PC/msvcrtmodule.c PC/winsound.c Python/import.c Python/marshal.c Python/sysmodule.c
andrew.kuchling
python-checkins at python.org
Wed Sep 27 21:17:41 CEST 2006
Author: andrew.kuchling
Date: Wed Sep 27 21:17:32 2006
New Revision: 52017
Modified:
python/branches/release24-maint/Misc/NEWS
python/branches/release24-maint/Modules/_bsddb.c
python/branches/release24-maint/Modules/_curses_panel.c
python/branches/release24-maint/Modules/_cursesmodule.c
python/branches/release24-maint/Modules/_heapqmodule.c
python/branches/release24-maint/Modules/_localemodule.c
python/branches/release24-maint/Modules/_randommodule.c
python/branches/release24-maint/Modules/_sre.c
python/branches/release24-maint/Modules/_ssl.c
python/branches/release24-maint/Modules/_testcapimodule.c
python/branches/release24-maint/Modules/_tkinter.c
python/branches/release24-maint/Modules/almodule.c
python/branches/release24-maint/Modules/arraymodule.c
python/branches/release24-maint/Modules/audioop.c
python/branches/release24-maint/Modules/binascii.c
python/branches/release24-maint/Modules/bsddbmodule.c
python/branches/release24-maint/Modules/bz2module.c
python/branches/release24-maint/Modules/cPickle.c
python/branches/release24-maint/Modules/cStringIO.c
python/branches/release24-maint/Modules/cdmodule.c
python/branches/release24-maint/Modules/clmodule.c
python/branches/release24-maint/Modules/cmathmodule.c
python/branches/release24-maint/Modules/collectionsmodule.c
python/branches/release24-maint/Modules/datetimemodule.c
python/branches/release24-maint/Modules/dbmmodule.c
python/branches/release24-maint/Modules/dlmodule.c
python/branches/release24-maint/Modules/errnomodule.c
python/branches/release24-maint/Modules/fcntlmodule.c
python/branches/release24-maint/Modules/flmodule.c
python/branches/release24-maint/Modules/fmmodule.c
python/branches/release24-maint/Modules/fpectlmodule.c
python/branches/release24-maint/Modules/fpetestmodule.c
python/branches/release24-maint/Modules/gcmodule.c
python/branches/release24-maint/Modules/gdbmmodule.c
python/branches/release24-maint/Modules/grpmodule.c
python/branches/release24-maint/Modules/imageop.c
python/branches/release24-maint/Modules/imgfile.c
python/branches/release24-maint/Modules/itertoolsmodule.c
python/branches/release24-maint/Modules/linuxaudiodev.c
python/branches/release24-maint/Modules/mathmodule.c
python/branches/release24-maint/Modules/md5module.c
python/branches/release24-maint/Modules/mmapmodule.c
python/branches/release24-maint/Modules/nismodule.c
python/branches/release24-maint/Modules/operator.c
python/branches/release24-maint/Modules/ossaudiodev.c
python/branches/release24-maint/Modules/parsermodule.c
python/branches/release24-maint/Modules/posixmodule.c
python/branches/release24-maint/Modules/puremodule.c
python/branches/release24-maint/Modules/pwdmodule.c
python/branches/release24-maint/Modules/pyexpat.c
python/branches/release24-maint/Modules/readline.c
python/branches/release24-maint/Modules/regexmodule.c
python/branches/release24-maint/Modules/resource.c
python/branches/release24-maint/Modules/rgbimgmodule.c
python/branches/release24-maint/Modules/selectmodule.c
python/branches/release24-maint/Modules/shamodule.c
python/branches/release24-maint/Modules/signalmodule.c
python/branches/release24-maint/Modules/socketmodule.c
python/branches/release24-maint/Modules/stropmodule.c
python/branches/release24-maint/Modules/structmodule.c
python/branches/release24-maint/Modules/sunaudiodev.c
python/branches/release24-maint/Modules/svmodule.c
python/branches/release24-maint/Modules/symtablemodule.c
python/branches/release24-maint/Modules/syslogmodule.c
python/branches/release24-maint/Modules/termios.c
python/branches/release24-maint/Modules/threadmodule.c
python/branches/release24-maint/Modules/timemodule.c
python/branches/release24-maint/Modules/xxmodule.c
python/branches/release24-maint/PC/_subprocess.c
python/branches/release24-maint/PC/_winreg.c
python/branches/release24-maint/PC/msvcrtmodule.c
python/branches/release24-maint/PC/winsound.c
python/branches/release24-maint/Python/import.c
python/branches/release24-maint/Python/marshal.c
python/branches/release24-maint/Python/sysmodule.c
Log:
[Backport of rev. 42093 by neal.norwitz]
Check return result from Py_InitModule*(). This API can fail.
Probably should be backported.
Modified: python/branches/release24-maint/Misc/NEWS
==============================================================================
--- python/branches/release24-maint/Misc/NEWS (original)
+++ python/branches/release24-maint/Misc/NEWS Wed Sep 27 21:17:32 2006
@@ -15,6 +15,8 @@
- Overflow checking code in integer division ran afoul of new gcc
optimizations. Changed to be more standard-conforming.
+- Fix warnings reported by Klocwork's static analysis tool.
+
- Patch #1541585: fix buffer overrun when performing repr() on
a unicode string in a build with wide unicode (UCS-4) support.
Modified: python/branches/release24-maint/Modules/_bsddb.c
==============================================================================
--- python/branches/release24-maint/Modules/_bsddb.c (original)
+++ python/branches/release24-maint/Modules/_bsddb.c Wed Sep 27 21:17:32 2006
@@ -4846,6 +4846,8 @@
/* Create the module and add the functions */
m = Py_InitModule(_bsddbModuleName, bsddb_methods);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
Modified: python/branches/release24-maint/Modules/_curses_panel.c
==============================================================================
--- python/branches/release24-maint/Modules/_curses_panel.c (original)
+++ python/branches/release24-maint/Modules/_curses_panel.c Wed Sep 27 21:17:32 2006
@@ -464,6 +464,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 */
Modified: python/branches/release24-maint/Modules/_cursesmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/_cursesmodule.c (original)
+++ python/branches/release24-maint/Modules/_cursesmodule.c Wed Sep 27 21:17:32 2006
@@ -2488,6 +2488,8 @@
/* Create the module and add the functions */
m = Py_InitModule("_curses", PyCurses_methods);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
Modified: python/branches/release24-maint/Modules/_heapqmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/_heapqmodule.c (original)
+++ python/branches/release24-maint/Modules/_heapqmodule.c Wed Sep 27 21:17:32 2006
@@ -610,6 +610,8 @@
PyObject *m;
m = Py_InitModule3("_heapq", heapq_methods, module_doc);
+ if (m == NULL)
+ return;
PyModule_AddObject(m, "__about__", PyString_FromString(__about__));
}
Modified: python/branches/release24-maint/Modules/_localemodule.c
==============================================================================
--- python/branches/release24-maint/Modules/_localemodule.c (original)
+++ python/branches/release24-maint/Modules/_localemodule.c Wed Sep 27 21:17:32 2006
@@ -715,6 +715,8 @@
#endif
m = Py_InitModule("_locale", PyLocale_Methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
Modified: python/branches/release24-maint/Modules/_randommodule.c
==============================================================================
--- python/branches/release24-maint/Modules/_randommodule.c (original)
+++ python/branches/release24-maint/Modules/_randommodule.c Wed Sep 27 21:17:32 2006
@@ -573,6 +573,8 @@
if (PyType_Ready(&Random_Type) < 0)
return;
m = Py_InitModule3("_random", NULL, module_doc);
+ if (m == NULL)
+ return;
Py_INCREF(&Random_Type);
PyModule_AddObject(m, "Random", (PyObject *)&Random_Type);
}
Modified: python/branches/release24-maint/Modules/_sre.c
==============================================================================
--- python/branches/release24-maint/Modules/_sre.c (original)
+++ python/branches/release24-maint/Modules/_sre.c Wed Sep 27 21:17:32 2006
@@ -3389,6 +3389,8 @@
Scanner_Type.ob_type = &PyType_Type;
m = Py_InitModule("_" SRE_MODULE, _functions);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
x = PyInt_FromLong(SRE_MAGIC);
Modified: python/branches/release24-maint/Modules/_ssl.c
==============================================================================
--- python/branches/release24-maint/Modules/_ssl.c (original)
+++ python/branches/release24-maint/Modules/_ssl.c Wed Sep 27 21:17:32 2006
@@ -657,6 +657,8 @@
PySSL_Type.ob_type = &PyType_Type;
m = Py_InitModule3("_ssl", PySSL_methods, module_doc);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
/* Load _socket module and its C API */
Modified: python/branches/release24-maint/Modules/_testcapimodule.c
==============================================================================
--- python/branches/release24-maint/Modules/_testcapimodule.c (original)
+++ python/branches/release24-maint/Modules/_testcapimodule.c Wed Sep 27 21:17:32 2006
@@ -856,6 +856,8 @@
Copyable_Type.ob_type = &PyType_Type;
m = Py_InitModule("_testcapi", TestMethods);
+ if (m == NULL)
+ return;
PyModule_AddObject(m, "UCHAR_MAX", PyInt_FromLong(UCHAR_MAX));
PyModule_AddObject(m, "USHRT_MAX", PyInt_FromLong(USHRT_MAX));
Modified: python/branches/release24-maint/Modules/_tkinter.c
==============================================================================
--- python/branches/release24-maint/Modules/_tkinter.c (original)
+++ python/branches/release24-maint/Modules/_tkinter.c Wed Sep 27 21:17:32 2006
@@ -3093,6 +3093,8 @@
#endif
m = Py_InitModule("_tkinter", moduleMethods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
Tkinter_TclError = PyErr_NewException("_tkinter.TclError", NULL, NULL);
Modified: python/branches/release24-maint/Modules/almodule.c
==============================================================================
--- python/branches/release24-maint/Modules/almodule.c (original)
+++ python/branches/release24-maint/Modules/almodule.c Wed Sep 27 21:17:32 2006
@@ -1998,6 +1998,8 @@
m = Py_InitModule4("al", al_methods,
al_module_documentation,
(PyObject*)NULL,PYTHON_API_VERSION);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
Modified: python/branches/release24-maint/Modules/arraymodule.c
==============================================================================
--- python/branches/release24-maint/Modules/arraymodule.c (original)
+++ python/branches/release24-maint/Modules/arraymodule.c Wed Sep 27 21:17:32 2006
@@ -2096,6 +2096,8 @@
Arraytype.ob_type = &PyType_Type;
PyArrayIter_Type.ob_type = &PyType_Type;
m = Py_InitModule3("array", a_methods, module_doc);
+ if (m == NULL)
+ return;
Py_INCREF((PyObject *)&Arraytype);
PyModule_AddObject(m, "ArrayType", (PyObject *)&Arraytype);
Modified: python/branches/release24-maint/Modules/audioop.c
==============================================================================
--- python/branches/release24-maint/Modules/audioop.c (original)
+++ python/branches/release24-maint/Modules/audioop.c Wed Sep 27 21:17:32 2006
@@ -1376,6 +1376,8 @@
{
PyObject *m, *d;
m = Py_InitModule("audioop", audioop_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
AudioopError = PyErr_NewException("audioop.error", NULL, NULL);
if (AudioopError != NULL)
Modified: python/branches/release24-maint/Modules/binascii.c
==============================================================================
--- python/branches/release24-maint/Modules/binascii.c (original)
+++ python/branches/release24-maint/Modules/binascii.c Wed Sep 27 21:17:32 2006
@@ -1334,6 +1334,8 @@
/* Create the module and add the functions */
m = Py_InitModule("binascii", binascii_module_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
x = PyString_FromString(doc_binascii);
Modified: python/branches/release24-maint/Modules/bsddbmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/bsddbmodule.c (original)
+++ python/branches/release24-maint/Modules/bsddbmodule.c Wed Sep 27 21:17:32 2006
@@ -849,6 +849,8 @@
Bsddbtype.ob_type = &PyType_Type;
m = Py_InitModule("bsddb185", bsddbmodule_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
BsddbError = PyErr_NewException("bsddb.error", NULL, NULL);
if (BsddbError != NULL)
Modified: python/branches/release24-maint/Modules/bz2module.c
==============================================================================
--- python/branches/release24-maint/Modules/bz2module.c (original)
+++ python/branches/release24-maint/Modules/bz2module.c Wed Sep 27 21:17:32 2006
@@ -2197,6 +2197,8 @@
BZ2Decomp_Type.ob_type = &PyType_Type;
m = Py_InitModule3("bz2", bz2_methods, bz2__doc__);
+ if (m == NULL)
+ return;
PyModule_AddObject(m, "__author__", PyString_FromString(__author__));
Modified: python/branches/release24-maint/Modules/cPickle.c
==============================================================================
--- python/branches/release24-maint/Modules/cPickle.c (original)
+++ python/branches/release24-maint/Modules/cPickle.c Wed Sep 27 21:17:32 2006
@@ -5741,6 +5741,8 @@
m = Py_InitModule4("cPickle", cPickle_methods,
cPickle_module_documentation,
(PyObject*)NULL,PYTHON_API_VERSION);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
Modified: python/branches/release24-maint/Modules/cStringIO.c
==============================================================================
--- python/branches/release24-maint/Modules/cStringIO.c (original)
+++ python/branches/release24-maint/Modules/cStringIO.c Wed Sep 27 21:17:32 2006
@@ -718,6 +718,7 @@
m = Py_InitModule4("cStringIO", IO_methods,
cStringIO_module_documentation,
(PyObject*)NULL,PYTHON_API_VERSION);
+ if (m == NULL) return;
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
Modified: python/branches/release24-maint/Modules/cdmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/cdmodule.c (original)
+++ python/branches/release24-maint/Modules/cdmodule.c Wed Sep 27 21:17:32 2006
@@ -760,6 +760,8 @@
PyObject *m, *d;
m = Py_InitModule("cd", CD_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
CdError = PyErr_NewException("cd.error", NULL, NULL);
Modified: python/branches/release24-maint/Modules/clmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/clmodule.c (original)
+++ python/branches/release24-maint/Modules/clmodule.c Wed Sep 27 21:17:32 2006
@@ -963,6 +963,8 @@
PyObject *m, *d, *x;
m = Py_InitModule("cl", cl_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
ClError = PyErr_NewException("cl.error", NULL, NULL);
Modified: python/branches/release24-maint/Modules/cmathmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/cmathmodule.c (original)
+++ python/branches/release24-maint/Modules/cmathmodule.c Wed Sep 27 21:17:32 2006
@@ -417,6 +417,8 @@
PyObject *m;
m = Py_InitModule3("cmath", cmath_methods, module_doc);
+ if (m == NULL)
+ return;
PyModule_AddObject(m, "pi",
PyFloat_FromDouble(atan(1.0) * 4.0));
Modified: python/branches/release24-maint/Modules/collectionsmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/collectionsmodule.c (original)
+++ python/branches/release24-maint/Modules/collectionsmodule.c Wed Sep 27 21:17:32 2006
@@ -1036,6 +1036,8 @@
PyObject *m;
m = Py_InitModule3("collections", NULL, module_doc);
+ if (m == NULL)
+ return;
if (PyType_Ready(&deque_type) < 0)
return;
Modified: python/branches/release24-maint/Modules/datetimemodule.c
==============================================================================
--- python/branches/release24-maint/Modules/datetimemodule.c (original)
+++ python/branches/release24-maint/Modules/datetimemodule.c Wed Sep 27 21:17:32 2006
@@ -4581,6 +4581,8 @@
m = Py_InitModule3("datetime", module_methods,
"Fast implementation of the datetime type.");
+ if (m == NULL)
+ return;
if (PyType_Ready(&PyDateTime_DateType) < 0)
return;
Modified: python/branches/release24-maint/Modules/dbmmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/dbmmodule.c (original)
+++ python/branches/release24-maint/Modules/dbmmodule.c Wed Sep 27 21:17:32 2006
@@ -359,6 +359,8 @@
Dbmtype.ob_type = &PyType_Type;
m = Py_InitModule("dbm", dbmmodule_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
if (DbmError == NULL)
DbmError = PyErr_NewException("dbm.error", NULL, NULL);
Modified: python/branches/release24-maint/Modules/dlmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/dlmodule.c (original)
+++ python/branches/release24-maint/Modules/dlmodule.c Wed Sep 27 21:17:32 2006
@@ -219,6 +219,8 @@
/* Create the module and add the functions */
m = Py_InitModule("dl", dl_methods);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
Modified: python/branches/release24-maint/Modules/errnomodule.c
==============================================================================
--- python/branches/release24-maint/Modules/errnomodule.c (original)
+++ python/branches/release24-maint/Modules/errnomodule.c Wed Sep 27 21:17:32 2006
@@ -57,6 +57,8 @@
{
PyObject *m, *d, *de;
m = Py_InitModule3("errno", errno_methods, errno__doc__);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
de = PyDict_New();
if (!d || !de || PyDict_SetItemString(d, "errorcode", de) < 0)
Modified: python/branches/release24-maint/Modules/fcntlmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/fcntlmodule.c (original)
+++ python/branches/release24-maint/Modules/fcntlmodule.c Wed Sep 27 21:17:32 2006
@@ -598,6 +598,8 @@
/* Create the module and add the functions and documentation */
m = Py_InitModule3("fcntl", fcntl_methods, module_doc);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
Modified: python/branches/release24-maint/Modules/flmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/flmodule.c (original)
+++ python/branches/release24-maint/Modules/flmodule.c Wed Sep 27 21:17:32 2006
@@ -2130,6 +2130,8 @@
initfl(void)
{
Py_InitModule("fl", forms_methods);
+ if (m == NULL)
+ return;
foreground();
fl_init();
}
Modified: python/branches/release24-maint/Modules/fmmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/fmmodule.c (original)
+++ python/branches/release24-maint/Modules/fmmodule.c Wed Sep 27 21:17:32 2006
@@ -258,5 +258,7 @@
initfm(void)
{
Py_InitModule("fm", fm_methods);
+ if (m == NULL)
+ return;
fminit();
}
Modified: python/branches/release24-maint/Modules/fpectlmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/fpectlmodule.c (original)
+++ python/branches/release24-maint/Modules/fpectlmodule.c Wed Sep 27 21:17:32 2006
@@ -265,6 +265,8 @@
{
PyObject *m, *d;
m = Py_InitModule("fpectl", fpectl_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
fpe_error = PyErr_NewException("fpectl.error", NULL, NULL);
if (fpe_error != NULL)
Modified: python/branches/release24-maint/Modules/fpetestmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/fpetestmodule.c (original)
+++ python/branches/release24-maint/Modules/fpetestmodule.c Wed Sep 27 21:17:32 2006
@@ -177,6 +177,8 @@
PyObject *m, *d;
m = Py_InitModule("fpetest", fpetest_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
fpe_error = PyErr_NewException("fpetest.error", NULL, NULL);
if (fpe_error != NULL)
Modified: python/branches/release24-maint/Modules/gcmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/gcmodule.c (original)
+++ python/branches/release24-maint/Modules/gcmodule.c Wed Sep 27 21:17:32 2006
@@ -1161,6 +1161,8 @@
gc__doc__,
NULL,
PYTHON_API_VERSION);
+ if (m == NULL)
+ return;
if (garbage == NULL) {
garbage = PyList_New(0);
Modified: python/branches/release24-maint/Modules/gdbmmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/gdbmmodule.c (original)
+++ python/branches/release24-maint/Modules/gdbmmodule.c Wed Sep 27 21:17:32 2006
@@ -512,6 +512,8 @@
m = Py_InitModule4("gdbm", dbmmodule_methods,
gdbmmodule__doc__, (PyObject *)NULL,
PYTHON_API_VERSION);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
DbmError = PyErr_NewException("gdbm.error", NULL, NULL);
if (DbmError != NULL) {
Modified: python/branches/release24-maint/Modules/grpmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/grpmodule.c (original)
+++ python/branches/release24-maint/Modules/grpmodule.c Wed Sep 27 21:17:32 2006
@@ -171,6 +171,8 @@
{
PyObject *m, *d;
m = Py_InitModule3("grp", grp_methods, grp__doc__);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
PyStructSequence_InitType(&StructGrpType, &struct_group_type_desc);
PyDict_SetItemString(d, "struct_group", (PyObject *) &StructGrpType);
Modified: python/branches/release24-maint/Modules/imageop.c
==============================================================================
--- python/branches/release24-maint/Modules/imageop.c (original)
+++ python/branches/release24-maint/Modules/imageop.c Wed Sep 27 21:17:32 2006
@@ -776,6 +776,8 @@
{
PyObject *m;
m = Py_InitModule("imageop", imageop_methods);
+ if (m == NULL)
+ return;
ImageopDict = PyModule_GetDict(m);
ImageopError = PyErr_NewException("imageop.error", NULL, NULL);
if (ImageopError != NULL)
Modified: python/branches/release24-maint/Modules/imgfile.c
==============================================================================
--- python/branches/release24-maint/Modules/imgfile.c (original)
+++ python/branches/release24-maint/Modules/imgfile.c Wed Sep 27 21:17:32 2006
@@ -492,6 +492,8 @@
{
PyObject *m, *d;
m = Py_InitModule("imgfile", imgfile_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
ImgfileError = PyErr_NewException("imgfile.error", NULL, NULL);
if (ImgfileError != NULL)
Modified: python/branches/release24-maint/Modules/itertoolsmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/itertoolsmodule.c (original)
+++ python/branches/release24-maint/Modules/itertoolsmodule.c Wed Sep 27 21:17:32 2006
@@ -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)
Modified: python/branches/release24-maint/Modules/linuxaudiodev.c
==============================================================================
--- python/branches/release24-maint/Modules/linuxaudiodev.c (original)
+++ python/branches/release24-maint/Modules/linuxaudiodev.c Wed Sep 27 21:17:32 2006
@@ -491,6 +491,8 @@
PyObject *m;
m = Py_InitModule("linuxaudiodev", linuxaudiodev_methods);
+ if (m == NULL)
+ return;
LinuxAudioError = PyErr_NewException("linuxaudiodev.error", NULL, NULL);
if (LinuxAudioError)
Modified: python/branches/release24-maint/Modules/mathmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/mathmodule.c (original)
+++ python/branches/release24-maint/Modules/mathmodule.c Wed Sep 27 21:17:32 2006
@@ -355,6 +355,8 @@
PyObject *m, *d, *v;
m = Py_InitModule3("math", math_methods, module_doc);
+ if (m == NULL)
+ goto finally;
d = PyModule_GetDict(m);
if (!(v = PyFloat_FromDouble(atan(1.0) * 4.0)))
Modified: python/branches/release24-maint/Modules/md5module.c
==============================================================================
--- python/branches/release24-maint/Modules/md5module.c (original)
+++ python/branches/release24-maint/Modules/md5module.c Wed Sep 27 21:17:32 2006
@@ -261,6 +261,8 @@
MD5type.ob_type = &PyType_Type;
m = Py_InitModule3("md5", md5_functions, module_doc);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
PyDict_SetItemString(d, "MD5Type", (PyObject *)&MD5type);
PyModule_AddIntConstant(m, "digest_size", 16);
Modified: python/branches/release24-maint/Modules/mmapmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/mmapmodule.c (original)
+++ python/branches/release24-maint/Modules/mmapmodule.c Wed Sep 27 21:17:32 2006
@@ -1093,6 +1093,8 @@
mmap_object_type.ob_type = &PyType_Type;
module = Py_InitModule ("mmap", mmap_functions);
+ if (module == NULL)
+ return;
dict = PyModule_GetDict (module);
mmap_module_error = PyExc_EnvironmentError;
Py_INCREF(mmap_module_error);
Modified: python/branches/release24-maint/Modules/nismodule.c
==============================================================================
--- python/branches/release24-maint/Modules/nismodule.c (original)
+++ python/branches/release24-maint/Modules/nismodule.c Wed Sep 27 21:17:32 2006
@@ -379,6 +379,8 @@
{
PyObject *m, *d;
m = Py_InitModule("nis", nis_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
NisError = PyErr_NewException("nis.error", NULL, NULL);
if (NisError != NULL)
Modified: python/branches/release24-maint/Modules/operator.c
==============================================================================
--- python/branches/release24-maint/Modules/operator.c (original)
+++ python/branches/release24-maint/Modules/operator.c Wed Sep 27 21:17:32 2006
@@ -480,6 +480,8 @@
/* Create the module and add the functions */
m = Py_InitModule4("operator", operator_methods, operator_doc,
(PyObject*)NULL, PYTHON_API_VERSION);
+ if (m == NULL)
+ return;
if (PyType_Ready(&itemgetter_type) < 0)
return;
Modified: python/branches/release24-maint/Modules/ossaudiodev.c
==============================================================================
--- python/branches/release24-maint/Modules/ossaudiodev.c (original)
+++ python/branches/release24-maint/Modules/ossaudiodev.c Wed Sep 27 21:17:32 2006
@@ -943,6 +943,8 @@
PyObject *m;
m = Py_InitModule("ossaudiodev", ossaudiodev_methods);
+ if (m == NULL)
+ return;
OSSAudioError = PyErr_NewException("ossaudiodev.OSSAudioError",
NULL, NULL);
Modified: python/branches/release24-maint/Modules/parsermodule.c
==============================================================================
--- python/branches/release24-maint/Modules/parsermodule.c (original)
+++ python/branches/release24-maint/Modules/parsermodule.c Wed Sep 27 21:17:32 2006
@@ -3106,6 +3106,8 @@
PyST_Type.ob_type = &PyType_Type;
module = Py_InitModule("parser", parser_functions);
+ if (module == NULL)
+ return;
if (parser_error == 0)
parser_error = PyErr_NewException("parser.ParserError", NULL, NULL);
Modified: python/branches/release24-maint/Modules/posixmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/posixmodule.c (original)
+++ python/branches/release24-maint/Modules/posixmodule.c Wed Sep 27 21:17:32 2006
@@ -7935,6 +7935,8 @@
m = Py_InitModule3(MODNAME,
posix_methods,
posix__doc__);
+ if (m == NULL)
+ return;
/* Initialize environ dictionary */
v = convertenviron();
Modified: python/branches/release24-maint/Modules/puremodule.c
==============================================================================
--- python/branches/release24-maint/Modules/puremodule.c (original)
+++ python/branches/release24-maint/Modules/puremodule.c Wed Sep 27 21:17:32 2006
@@ -952,6 +952,8 @@
PyObject *m, *d;
m = Py_InitModule("pure", pure_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
/* this is bogus because we should be able to find this information
Modified: python/branches/release24-maint/Modules/pwdmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/pwdmodule.c (original)
+++ python/branches/release24-maint/Modules/pwdmodule.c Wed Sep 27 21:17:32 2006
@@ -183,6 +183,8 @@
{
PyObject *m;
m = Py_InitModule3("pwd", pwd_methods, pwd__doc__);
+ if (m == NULL)
+ return;
PyStructSequence_InitType(&StructPwdType, &struct_pwd_type_desc);
Py_INCREF((PyObject *) &StructPwdType);
Modified: python/branches/release24-maint/Modules/pyexpat.c
==============================================================================
--- python/branches/release24-maint/Modules/pyexpat.c (original)
+++ python/branches/release24-maint/Modules/pyexpat.c Wed Sep 27 21:17:32 2006
@@ -1853,6 +1853,8 @@
/* Create the module and add the functions */
m = Py_InitModule3(MODULE_NAME, pyexpat_methods,
pyexpat_module_documentation);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
if (ErrorObject == NULL) {
Modified: python/branches/release24-maint/Modules/readline.c
==============================================================================
--- python/branches/release24-maint/Modules/readline.c (original)
+++ python/branches/release24-maint/Modules/readline.c Wed Sep 27 21:17:32 2006
@@ -927,6 +927,8 @@
m = Py_InitModule4("readline", readline_methods, doc_module,
(PyObject *)NULL, PYTHON_API_VERSION);
+ if (m == NULL)
+ return;
PyOS_ReadlineFunctionPointer = call_readline;
setup_readline();
Modified: python/branches/release24-maint/Modules/regexmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/regexmodule.c (original)
+++ python/branches/release24-maint/Modules/regexmodule.c Wed Sep 27 21:17:32 2006
@@ -652,6 +652,8 @@
Regextype.ob_type = &PyType_Type;
m = Py_InitModule("regex", regex_global_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
if (PyErr_Warn(PyExc_DeprecationWarning,
Modified: python/branches/release24-maint/Modules/resource.c
==============================================================================
--- python/branches/release24-maint/Modules/resource.c (original)
+++ python/branches/release24-maint/Modules/resource.c Wed Sep 27 21:17:32 2006
@@ -234,6 +234,8 @@
/* Create the module and add the functions */
m = Py_InitModule("resource", resource_methods);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
if (ResourceError == NULL) {
Modified: python/branches/release24-maint/Modules/rgbimgmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/rgbimgmodule.c (original)
+++ python/branches/release24-maint/Modules/rgbimgmodule.c Wed Sep 27 21:17:32 2006
@@ -756,6 +756,8 @@
{
PyObject *m, *d;
m = Py_InitModule("rgbimg", rgbimg_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
ImgfileError = PyErr_NewException("rgbimg.error", NULL, NULL);
if (ImgfileError != NULL)
Modified: python/branches/release24-maint/Modules/selectmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/selectmodule.c (original)
+++ python/branches/release24-maint/Modules/selectmodule.c Wed Sep 27 21:17:32 2006
@@ -662,6 +662,8 @@
{
PyObject *m;
m = Py_InitModule3("select", select_methods, module_doc);
+ if (m == NULL)
+ return;
SelectError = PyErr_NewException("select.error", NULL, NULL);
Py_INCREF(SelectError);
Modified: python/branches/release24-maint/Modules/shamodule.c
==============================================================================
--- python/branches/release24-maint/Modules/shamodule.c (original)
+++ python/branches/release24-maint/Modules/shamodule.c Wed Sep 27 21:17:32 2006
@@ -532,6 +532,8 @@
SHAtype.ob_type = &PyType_Type;
m = Py_InitModule("sha", SHA_functions);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
insint("blocksize", 1); /* For future use, in case some hash
Modified: python/branches/release24-maint/Modules/signalmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/signalmodule.c (original)
+++ python/branches/release24-maint/Modules/signalmodule.c Wed Sep 27 21:17:32 2006
@@ -317,6 +317,8 @@
/* Create the module and add the functions */
m = Py_InitModule3("signal", signal_methods, module_doc);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
Modified: python/branches/release24-maint/Modules/socketmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/socketmodule.c (original)
+++ python/branches/release24-maint/Modules/socketmodule.c Wed Sep 27 21:17:32 2006
@@ -3872,6 +3872,8 @@
m = Py_InitModule3(PySocket_MODULE_NAME,
socket_methods,
socket_doc);
+ if (m == NULL)
+ return;
socket_error = PyErr_NewException("socket.error", NULL, NULL);
if (socket_error == NULL)
Modified: python/branches/release24-maint/Modules/stropmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/stropmodule.c (original)
+++ python/branches/release24-maint/Modules/stropmodule.c Wed Sep 27 21:17:32 2006
@@ -1210,6 +1210,8 @@
int c, n;
m = Py_InitModule4("strop", strop_methods, strop_module__doc__,
(PyObject*)NULL, PYTHON_API_VERSION);
+ if (m == NULL)
+ return;
/* Create 'whitespace' object */
n = 0;
Modified: python/branches/release24-maint/Modules/structmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/structmodule.c (original)
+++ python/branches/release24-maint/Modules/structmodule.c Wed Sep 27 21:17:32 2006
@@ -1278,6 +1278,8 @@
/* Create the module and add the functions */
m = Py_InitModule4("struct", struct_methods, struct__doc__,
(PyObject*)NULL, PYTHON_API_VERSION);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
if (StructError == NULL) {
Modified: python/branches/release24-maint/Modules/sunaudiodev.c
==============================================================================
--- python/branches/release24-maint/Modules/sunaudiodev.c (original)
+++ python/branches/release24-maint/Modules/sunaudiodev.c Wed Sep 27 21:17:32 2006
@@ -456,6 +456,8 @@
PyObject *m, *d;
m = Py_InitModule("sunaudiodev", sunaudiodev_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
SunAudioError = PyErr_NewException("sunaudiodev.error", NULL, NULL);
if (SunAudioError)
Modified: python/branches/release24-maint/Modules/svmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/svmodule.c (original)
+++ python/branches/release24-maint/Modules/svmodule.c Wed Sep 27 21:17:32 2006
@@ -956,6 +956,8 @@
PyObject *m, *d;
m = Py_InitModule("sv", sv_methods);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
SvError = PyErr_NewException("sv.error", NULL, NULL);
Modified: python/branches/release24-maint/Modules/symtablemodule.c
==============================================================================
--- python/branches/release24-maint/Modules/symtablemodule.c (original)
+++ python/branches/release24-maint/Modules/symtablemodule.c Wed Sep 27 21:17:32 2006
@@ -51,6 +51,8 @@
PyObject *m;
m = Py_InitModule("_symtable", symtable_methods);
+ if (m == NULL)
+ return;
PyModule_AddIntConstant(m, "USE", USE);
PyModule_AddIntConstant(m, "DEF_GLOBAL", DEF_GLOBAL);
PyModule_AddIntConstant(m, "DEF_LOCAL", DEF_LOCAL);
Modified: python/branches/release24-maint/Modules/syslogmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/syslogmodule.c (original)
+++ python/branches/release24-maint/Modules/syslogmodule.c Wed Sep 27 21:17:32 2006
@@ -163,6 +163,8 @@
/* Create the module and add the functions */
m = Py_InitModule("syslog", syslog_methods);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
Modified: python/branches/release24-maint/Modules/termios.c
==============================================================================
--- python/branches/release24-maint/Modules/termios.c (original)
+++ python/branches/release24-maint/Modules/termios.c Wed Sep 27 21:17:32 2006
@@ -910,6 +910,8 @@
m = Py_InitModule4("termios", termios_methods, termios__doc__,
(PyObject *)NULL, PYTHON_API_VERSION);
+ if (m == NULL)
+ return;
if (TermiosError == NULL) {
TermiosError = PyErr_NewException("termios.error", NULL, NULL);
Modified: python/branches/release24-maint/Modules/threadmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/threadmodule.c (original)
+++ python/branches/release24-maint/Modules/threadmodule.c Wed Sep 27 21:17:32 2006
@@ -650,6 +650,8 @@
/* Create the module and add the functions */
m = Py_InitModule3("thread", thread_methods, thread_doc);
+ if (m == NULL)
+ return;
/* Add a symbolic constant */
d = PyModule_GetDict(m);
Modified: python/branches/release24-maint/Modules/timemodule.c
==============================================================================
--- python/branches/release24-maint/Modules/timemodule.c (original)
+++ python/branches/release24-maint/Modules/timemodule.c Wed Sep 27 21:17:32 2006
@@ -785,6 +785,8 @@
PyObject *m;
char *p;
m = Py_InitModule3("time", time_methods, module_doc);
+ if (m == NULL)
+ return;
/* Accept 2-digit dates unless PYTHONY2K is set and non-empty */
p = Py_GETENV("PYTHONY2K");
Modified: python/branches/release24-maint/Modules/xxmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/xxmodule.c (original)
+++ python/branches/release24-maint/Modules/xxmodule.c Wed Sep 27 21:17:32 2006
@@ -352,6 +352,8 @@
/* Create the module and add the functions */
m = Py_InitModule3("xx", xx_methods, module_doc);
+ if (m == NULL)
+ return;
/* Add some symbolic constants to the module */
if (ErrorObject == NULL) {
Modified: python/branches/release24-maint/PC/_subprocess.c
==============================================================================
--- python/branches/release24-maint/PC/_subprocess.c (original)
+++ python/branches/release24-maint/PC/_subprocess.c Wed Sep 27 21:17:32 2006
@@ -530,6 +530,8 @@
sp_handle_as_number.nb_int = (unaryfunc) sp_handle_as_int;
m = Py_InitModule("_subprocess", sp_functions);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
/* constants */
Modified: python/branches/release24-maint/PC/_winreg.c
==============================================================================
--- python/branches/release24-maint/PC/_winreg.c (original)
+++ python/branches/release24-maint/PC/_winreg.c Wed Sep 27 21:17:32 2006
@@ -1459,6 +1459,8 @@
{
PyObject *m, *d;
m = Py_InitModule3("_winreg", winreg_methods, module_doc);
+ if (m == NULL)
+ return;
d = PyModule_GetDict(m);
PyHKEY_Type.ob_type = &PyType_Type;
PyHKEY_Type.tp_doc = PyHKEY_doc;
Modified: python/branches/release24-maint/PC/msvcrtmodule.c
==============================================================================
--- python/branches/release24-maint/PC/msvcrtmodule.c (original)
+++ python/branches/release24-maint/PC/msvcrtmodule.c Wed Sep 27 21:17:32 2006
@@ -221,6 +221,8 @@
initmsvcrt(void)
{
PyObject *m = Py_InitModule("msvcrt", msvcrt_functions);
+ if (m == NULL)
+ return;
PyObject *d = PyModule_GetDict(m);
/* constants for the locking() function's mode argument */
Modified: python/branches/release24-maint/PC/winsound.c
==============================================================================
--- python/branches/release24-maint/PC/winsound.c (original)
+++ python/branches/release24-maint/PC/winsound.c Wed Sep 27 21:17:32 2006
@@ -218,6 +218,8 @@
PyObject *module = Py_InitModule3("winsound",
sound_methods,
sound_module_doc);
+ if (module == NULL)
+ return;
PyObject *dict = PyModule_GetDict(module);
ADD_DEFINE(SND_ASYNC);
Modified: python/branches/release24-maint/Python/import.c
==============================================================================
--- python/branches/release24-maint/Python/import.c (original)
+++ python/branches/release24-maint/Python/import.c Wed Sep 27 21:17:32 2006
@@ -2822,6 +2822,8 @@
m = Py_InitModule4("imp", imp_methods, doc_imp,
NULL, PYTHON_API_VERSION);
+ if (m == NULL)
+ goto failure;
d = PyModule_GetDict(m);
if (setint(d, "SEARCH_ERROR", SEARCH_ERROR) < 0) goto failure;
Modified: python/branches/release24-maint/Python/marshal.c
==============================================================================
--- python/branches/release24-maint/Python/marshal.c (original)
+++ python/branches/release24-maint/Python/marshal.c Wed Sep 27 21:17:32 2006
@@ -928,5 +928,7 @@
PyMarshal_Init(void)
{
PyObject *mod = Py_InitModule("marshal", marshal_methods);
+ if (mod == NULL)
+ return;
PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION);
}
Modified: python/branches/release24-maint/Python/sysmodule.c
==============================================================================
--- python/branches/release24-maint/Python/sysmodule.c (original)
+++ python/branches/release24-maint/Python/sysmodule.c Wed Sep 27 21:17:32 2006
@@ -944,6 +944,8 @@
#endif
m = Py_InitModule3("sys", sys_methods, sys_doc);
+ if (m == NULL)
+ return NULL;
sysdict = PyModule_GetDict(m);
{
More information about the Python-checkins
mailing list