Check return result from Py_InitModule*(). This API can fail.
Probably should be backported.
This commit is contained in:
parent
8207cc7fd6
commit
1ac754fa10
|
@ -5034,6 +5034,8 @@ DL_EXPORT(void) init_bsddb(void)
|
||||||
|
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule(_bsddbModuleName, bsddb_methods);
|
m = Py_InitModule(_bsddbModuleName, bsddb_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
|
@ -462,6 +462,8 @@ init_curses_panel(void)
|
||||||
|
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule("_curses_panel", PyCurses_methods);
|
m = Py_InitModule("_curses_panel", PyCurses_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
/* For exception _curses_panel.error */
|
/* For exception _curses_panel.error */
|
||||||
|
|
|
@ -2481,6 +2481,8 @@ init_curses(void)
|
||||||
|
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule("_curses", PyCurses_methods);
|
m = Py_InitModule("_curses", PyCurses_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
|
@ -2590,6 +2590,8 @@ init_elementtree(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m = Py_InitModule("_elementtree", _functions);
|
m = Py_InitModule("_elementtree", _functions);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* python glue code */
|
/* python glue code */
|
||||||
|
|
||||||
|
|
|
@ -610,6 +610,8 @@ init_heapq(void)
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
|
|
||||||
m = Py_InitModule3("_heapq", heapq_methods, module_doc);
|
m = Py_InitModule3("_heapq", heapq_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
PyModule_AddObject(m, "__about__", PyString_FromString(__about__));
|
PyModule_AddObject(m, "__about__", PyString_FromString(__about__));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -715,6 +715,8 @@ init_locale(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m = Py_InitModule("_locale", PyLocale_Methods);
|
m = Py_InitModule("_locale", PyLocale_Methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
|
|
|
@ -573,6 +573,8 @@ init_random(void)
|
||||||
if (PyType_Ready(&Random_Type) < 0)
|
if (PyType_Ready(&Random_Type) < 0)
|
||||||
return;
|
return;
|
||||||
m = Py_InitModule3("_random", NULL, module_doc);
|
m = Py_InitModule3("_random", NULL, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
Py_INCREF(&Random_Type);
|
Py_INCREF(&Random_Type);
|
||||||
PyModule_AddObject(m, "Random", (PyObject *)&Random_Type);
|
PyModule_AddObject(m, "Random", (PyObject *)&Random_Type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3389,6 +3389,8 @@ PyMODINIT_FUNC init_sre(void)
|
||||||
Scanner_Type.ob_type = &PyType_Type;
|
Scanner_Type.ob_type = &PyType_Type;
|
||||||
|
|
||||||
m = Py_InitModule("_" SRE_MODULE, _functions);
|
m = Py_InitModule("_" SRE_MODULE, _functions);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
x = PyInt_FromLong(SRE_MAGIC);
|
x = PyInt_FromLong(SRE_MAGIC);
|
||||||
|
|
|
@ -634,6 +634,8 @@ init_ssl(void)
|
||||||
PySSL_Type.ob_type = &PyType_Type;
|
PySSL_Type.ob_type = &PyType_Type;
|
||||||
|
|
||||||
m = Py_InitModule3("_ssl", PySSL_methods, module_doc);
|
m = Py_InitModule3("_ssl", PySSL_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
/* Load _socket module and its C API */
|
/* Load _socket module and its C API */
|
||||||
|
|
|
@ -627,6 +627,8 @@ init_testcapi(void)
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
|
|
||||||
m = Py_InitModule("_testcapi", TestMethods);
|
m = Py_InitModule("_testcapi", TestMethods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
PyModule_AddObject(m, "UCHAR_MAX", PyInt_FromLong(UCHAR_MAX));
|
PyModule_AddObject(m, "UCHAR_MAX", PyInt_FromLong(UCHAR_MAX));
|
||||||
PyModule_AddObject(m, "USHRT_MAX", PyInt_FromLong(USHRT_MAX));
|
PyModule_AddObject(m, "USHRT_MAX", PyInt_FromLong(USHRT_MAX));
|
||||||
|
|
|
@ -3088,6 +3088,8 @@ init_tkinter(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m = Py_InitModule("_tkinter", moduleMethods);
|
m = Py_InitModule("_tkinter", moduleMethods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
Tkinter_TclError = PyErr_NewException("_tkinter.TclError", NULL, NULL);
|
Tkinter_TclError = PyErr_NewException("_tkinter.TclError", NULL, NULL);
|
||||||
|
|
|
@ -1996,6 +1996,8 @@ inital(void)
|
||||||
m = Py_InitModule4("al", al_methods,
|
m = Py_InitModule4("al", al_methods,
|
||||||
al_module_documentation,
|
al_module_documentation,
|
||||||
(PyObject*)NULL,PYTHON_API_VERSION);
|
(PyObject*)NULL,PYTHON_API_VERSION);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
|
@ -2118,6 +2118,8 @@ initarray(void)
|
||||||
Arraytype.ob_type = &PyType_Type;
|
Arraytype.ob_type = &PyType_Type;
|
||||||
PyArrayIter_Type.ob_type = &PyType_Type;
|
PyArrayIter_Type.ob_type = &PyType_Type;
|
||||||
m = Py_InitModule3("array", a_methods, module_doc);
|
m = Py_InitModule3("array", a_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
Py_INCREF((PyObject *)&Arraytype);
|
Py_INCREF((PyObject *)&Arraytype);
|
||||||
PyModule_AddObject(m, "ArrayType", (PyObject *)&Arraytype);
|
PyModule_AddObject(m, "ArrayType", (PyObject *)&Arraytype);
|
||||||
|
|
|
@ -1374,6 +1374,8 @@ initaudioop(void)
|
||||||
{
|
{
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
m = Py_InitModule("audioop", audioop_methods);
|
m = Py_InitModule("audioop", audioop_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
AudioopError = PyErr_NewException("audioop.error", NULL, NULL);
|
AudioopError = PyErr_NewException("audioop.error", NULL, NULL);
|
||||||
if (AudioopError != NULL)
|
if (AudioopError != NULL)
|
||||||
|
|
|
@ -1335,6 +1335,8 @@ initbinascii(void)
|
||||||
|
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule("binascii", binascii_module_methods);
|
m = Py_InitModule("binascii", binascii_module_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
x = PyString_FromString(doc_binascii);
|
x = PyString_FromString(doc_binascii);
|
||||||
|
|
|
@ -849,6 +849,8 @@ initbsddb185(void) {
|
||||||
|
|
||||||
Bsddbtype.ob_type = &PyType_Type;
|
Bsddbtype.ob_type = &PyType_Type;
|
||||||
m = Py_InitModule("bsddb185", bsddbmodule_methods);
|
m = Py_InitModule("bsddb185", bsddbmodule_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
BsddbError = PyErr_NewException("bsddb.error", NULL, NULL);
|
BsddbError = PyErr_NewException("bsddb.error", NULL, NULL);
|
||||||
if (BsddbError != NULL)
|
if (BsddbError != NULL)
|
||||||
|
|
|
@ -2192,6 +2192,8 @@ initbz2(void)
|
||||||
BZ2Decomp_Type.ob_type = &PyType_Type;
|
BZ2Decomp_Type.ob_type = &PyType_Type;
|
||||||
|
|
||||||
m = Py_InitModule3("bz2", bz2_methods, bz2__doc__);
|
m = Py_InitModule3("bz2", bz2_methods, bz2__doc__);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
PyModule_AddObject(m, "__author__", PyString_FromString(__author__));
|
PyModule_AddObject(m, "__author__", PyString_FromString(__author__));
|
||||||
|
|
||||||
|
|
|
@ -5730,6 +5730,8 @@ initcPickle(void)
|
||||||
m = Py_InitModule4("cPickle", cPickle_methods,
|
m = Py_InitModule4("cPickle", cPickle_methods,
|
||||||
cPickle_module_documentation,
|
cPickle_module_documentation,
|
||||||
(PyObject*)NULL,PYTHON_API_VERSION);
|
(PyObject*)NULL,PYTHON_API_VERSION);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
|
@ -716,6 +716,7 @@ initcStringIO(void) {
|
||||||
m = Py_InitModule4("cStringIO", IO_methods,
|
m = Py_InitModule4("cStringIO", IO_methods,
|
||||||
cStringIO_module_documentation,
|
cStringIO_module_documentation,
|
||||||
(PyObject*)NULL,PYTHON_API_VERSION);
|
(PyObject*)NULL,PYTHON_API_VERSION);
|
||||||
|
if (m == NULL) return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
|
@ -760,6 +760,8 @@ initcd(void)
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
|
|
||||||
m = Py_InitModule("cd", CD_methods);
|
m = Py_InitModule("cd", CD_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
CdError = PyErr_NewException("cd.error", NULL, NULL);
|
CdError = PyErr_NewException("cd.error", NULL, NULL);
|
||||||
|
|
|
@ -963,6 +963,8 @@ initcl(void)
|
||||||
PyObject *m, *d, *x;
|
PyObject *m, *d, *x;
|
||||||
|
|
||||||
m = Py_InitModule("cl", cl_methods);
|
m = Py_InitModule("cl", cl_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
ClError = PyErr_NewException("cl.error", NULL, NULL);
|
ClError = PyErr_NewException("cl.error", NULL, NULL);
|
||||||
|
|
|
@ -417,6 +417,8 @@ initcmath(void)
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
|
|
||||||
m = Py_InitModule3("cmath", cmath_methods, module_doc);
|
m = Py_InitModule3("cmath", cmath_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
PyModule_AddObject(m, "pi",
|
PyModule_AddObject(m, "pi",
|
||||||
PyFloat_FromDouble(atan(1.0) * 4.0));
|
PyFloat_FromDouble(atan(1.0) * 4.0));
|
||||||
|
|
|
@ -1077,6 +1077,8 @@ initcollections(void)
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
|
|
||||||
m = Py_InitModule3("collections", NULL, module_doc);
|
m = Py_InitModule3("collections", NULL, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (PyType_Ready(&deque_type) < 0)
|
if (PyType_Ready(&deque_type) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -4615,6 +4615,8 @@ initdatetime(void)
|
||||||
|
|
||||||
m = Py_InitModule3("datetime", module_methods,
|
m = Py_InitModule3("datetime", module_methods,
|
||||||
"Fast implementation of the datetime type.");
|
"Fast implementation of the datetime type.");
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (PyType_Ready(&PyDateTime_DateType) < 0)
|
if (PyType_Ready(&PyDateTime_DateType) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -359,6 +359,8 @@ initdbm(void) {
|
||||||
|
|
||||||
Dbmtype.ob_type = &PyType_Type;
|
Dbmtype.ob_type = &PyType_Type;
|
||||||
m = Py_InitModule("dbm", dbmmodule_methods);
|
m = Py_InitModule("dbm", dbmmodule_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
if (DbmError == NULL)
|
if (DbmError == NULL)
|
||||||
DbmError = PyErr_NewException("dbm.error", NULL, NULL);
|
DbmError = PyErr_NewException("dbm.error", NULL, NULL);
|
||||||
|
|
|
@ -219,6 +219,8 @@ initdl(void)
|
||||||
|
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule("dl", dl_methods);
|
m = Py_InitModule("dl", dl_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
|
@ -57,6 +57,8 @@ initerrno(void)
|
||||||
{
|
{
|
||||||
PyObject *m, *d, *de;
|
PyObject *m, *d, *de;
|
||||||
m = Py_InitModule3("errno", errno_methods, errno__doc__);
|
m = Py_InitModule3("errno", errno_methods, errno__doc__);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
de = PyDict_New();
|
de = PyDict_New();
|
||||||
if (!d || !de || PyDict_SetItemString(d, "errorcode", de) < 0)
|
if (!d || !de || PyDict_SetItemString(d, "errorcode", de) < 0)
|
||||||
|
|
|
@ -583,6 +583,8 @@ initfcntl(void)
|
||||||
|
|
||||||
/* Create the module and add the functions and documentation */
|
/* Create the module and add the functions and documentation */
|
||||||
m = Py_InitModule3("fcntl", fcntl_methods, module_doc);
|
m = Py_InitModule3("fcntl", fcntl_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
|
@ -2130,6 +2130,8 @@ PyMODINIT_FUNC
|
||||||
initfl(void)
|
initfl(void)
|
||||||
{
|
{
|
||||||
Py_InitModule("fl", forms_methods);
|
Py_InitModule("fl", forms_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
foreground();
|
foreground();
|
||||||
fl_init();
|
fl_init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -258,5 +258,7 @@ void
|
||||||
initfm(void)
|
initfm(void)
|
||||||
{
|
{
|
||||||
Py_InitModule("fm", fm_methods);
|
Py_InitModule("fm", fm_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
fminit();
|
fminit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -265,6 +265,8 @@ PyMODINIT_FUNC initfpectl(void)
|
||||||
{
|
{
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
m = Py_InitModule("fpectl", fpectl_methods);
|
m = Py_InitModule("fpectl", fpectl_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
fpe_error = PyErr_NewException("fpectl.error", NULL, NULL);
|
fpe_error = PyErr_NewException("fpectl.error", NULL, NULL);
|
||||||
if (fpe_error != NULL)
|
if (fpe_error != NULL)
|
||||||
|
|
|
@ -177,6 +177,8 @@ PyMODINIT_FUNC initfpetest(void)
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
|
|
||||||
m = Py_InitModule("fpetest", fpetest_methods);
|
m = Py_InitModule("fpetest", fpetest_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
fpe_error = PyErr_NewException("fpetest.error", NULL, NULL);
|
fpe_error = PyErr_NewException("fpetest.error", NULL, NULL);
|
||||||
if (fpe_error != NULL)
|
if (fpe_error != NULL)
|
||||||
|
|
|
@ -263,6 +263,8 @@ initfunctional(void)
|
||||||
};
|
};
|
||||||
|
|
||||||
m = Py_InitModule3("functional", module_methods, module_doc);
|
m = Py_InitModule3("functional", module_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
for (i=0 ; typelist[i] != NULL ; i++) {
|
for (i=0 ; typelist[i] != NULL ; i++) {
|
||||||
if (PyType_Ready(typelist[i]) < 0)
|
if (PyType_Ready(typelist[i]) < 0)
|
||||||
|
|
|
@ -1158,6 +1158,8 @@ initgc(void)
|
||||||
gc__doc__,
|
gc__doc__,
|
||||||
NULL,
|
NULL,
|
||||||
PYTHON_API_VERSION);
|
PYTHON_API_VERSION);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (garbage == NULL) {
|
if (garbage == NULL) {
|
||||||
garbage = PyList_New(0);
|
garbage = PyList_New(0);
|
||||||
|
|
|
@ -512,6 +512,8 @@ initgdbm(void) {
|
||||||
m = Py_InitModule4("gdbm", dbmmodule_methods,
|
m = Py_InitModule4("gdbm", dbmmodule_methods,
|
||||||
gdbmmodule__doc__, (PyObject *)NULL,
|
gdbmmodule__doc__, (PyObject *)NULL,
|
||||||
PYTHON_API_VERSION);
|
PYTHON_API_VERSION);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
DbmError = PyErr_NewException("gdbm.error", NULL, NULL);
|
DbmError = PyErr_NewException("gdbm.error", NULL, NULL);
|
||||||
if (DbmError != NULL) {
|
if (DbmError != NULL) {
|
||||||
|
|
|
@ -171,6 +171,8 @@ initgrp(void)
|
||||||
{
|
{
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
m = Py_InitModule3("grp", grp_methods, grp__doc__);
|
m = Py_InitModule3("grp", grp_methods, grp__doc__);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
PyStructSequence_InitType(&StructGrpType, &struct_group_type_desc);
|
PyStructSequence_InitType(&StructGrpType, &struct_group_type_desc);
|
||||||
PyDict_SetItemString(d, "struct_group", (PyObject *) &StructGrpType);
|
PyDict_SetItemString(d, "struct_group", (PyObject *) &StructGrpType);
|
||||||
|
|
|
@ -776,6 +776,8 @@ initimageop(void)
|
||||||
{
|
{
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
m = Py_InitModule("imageop", imageop_methods);
|
m = Py_InitModule("imageop", imageop_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
ImageopDict = PyModule_GetDict(m);
|
ImageopDict = PyModule_GetDict(m);
|
||||||
ImageopError = PyErr_NewException("imageop.error", NULL, NULL);
|
ImageopError = PyErr_NewException("imageop.error", NULL, NULL);
|
||||||
if (ImageopError != NULL)
|
if (ImageopError != NULL)
|
||||||
|
|
|
@ -492,6 +492,8 @@ initimgfile(void)
|
||||||
{
|
{
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
m = Py_InitModule("imgfile", imgfile_methods);
|
m = Py_InitModule("imgfile", imgfile_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
ImgfileError = PyErr_NewException("imgfile.error", NULL, NULL);
|
ImgfileError = PyErr_NewException("imgfile.error", NULL, NULL);
|
||||||
if (ImgfileError != NULL)
|
if (ImgfileError != NULL)
|
||||||
|
|
|
@ -2460,6 +2460,8 @@ inititertools(void)
|
||||||
|
|
||||||
teedataobject_type.ob_type = &PyType_Type;
|
teedataobject_type.ob_type = &PyType_Type;
|
||||||
m = Py_InitModule3("itertools", module_methods, module_doc);
|
m = Py_InitModule3("itertools", module_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
for (i=0 ; typelist[i] != NULL ; i++) {
|
for (i=0 ; typelist[i] != NULL ; i++) {
|
||||||
if (PyType_Ready(typelist[i]) < 0)
|
if (PyType_Ready(typelist[i]) < 0)
|
||||||
|
|
|
@ -491,6 +491,8 @@ initlinuxaudiodev(void)
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
|
|
||||||
m = Py_InitModule("linuxaudiodev", linuxaudiodev_methods);
|
m = Py_InitModule("linuxaudiodev", linuxaudiodev_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
LinuxAudioError = PyErr_NewException("linuxaudiodev.error", NULL, NULL);
|
LinuxAudioError = PyErr_NewException("linuxaudiodev.error", NULL, NULL);
|
||||||
if (LinuxAudioError)
|
if (LinuxAudioError)
|
||||||
|
|
|
@ -355,6 +355,8 @@ initmath(void)
|
||||||
PyObject *m, *d, *v;
|
PyObject *m, *d, *v;
|
||||||
|
|
||||||
m = Py_InitModule3("math", math_methods, module_doc);
|
m = Py_InitModule3("math", math_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
goto finally;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
if (!(v = PyFloat_FromDouble(atan(1.0) * 4.0)))
|
if (!(v = PyFloat_FromDouble(atan(1.0) * 4.0)))
|
||||||
|
|
|
@ -303,6 +303,8 @@ init_md5(void)
|
||||||
if (PyType_Ready(&MD5type) < 0)
|
if (PyType_Ready(&MD5type) < 0)
|
||||||
return;
|
return;
|
||||||
m = Py_InitModule3("_md5", md5_functions, module_doc);
|
m = Py_InitModule3("_md5", md5_functions, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
PyDict_SetItemString(d, "MD5Type", (PyObject *)&MD5type);
|
PyDict_SetItemString(d, "MD5Type", (PyObject *)&MD5type);
|
||||||
PyModule_AddIntConstant(m, "digest_size", 16);
|
PyModule_AddIntConstant(m, "digest_size", 16);
|
||||||
|
|
|
@ -1092,6 +1092,8 @@ PyMODINIT_FUNC
|
||||||
mmap_object_type.ob_type = &PyType_Type;
|
mmap_object_type.ob_type = &PyType_Type;
|
||||||
|
|
||||||
module = Py_InitModule ("mmap", mmap_functions);
|
module = Py_InitModule ("mmap", mmap_functions);
|
||||||
|
if (module == NULL)
|
||||||
|
return;
|
||||||
dict = PyModule_GetDict (module);
|
dict = PyModule_GetDict (module);
|
||||||
mmap_module_error = PyExc_EnvironmentError;
|
mmap_module_error = PyExc_EnvironmentError;
|
||||||
Py_INCREF(mmap_module_error);
|
Py_INCREF(mmap_module_error);
|
||||||
|
|
|
@ -379,6 +379,8 @@ initnis (void)
|
||||||
{
|
{
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
m = Py_InitModule("nis", nis_methods);
|
m = Py_InitModule("nis", nis_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
NisError = PyErr_NewException("nis.error", NULL, NULL);
|
NisError = PyErr_NewException("nis.error", NULL, NULL);
|
||||||
if (NisError != NULL)
|
if (NisError != NULL)
|
||||||
|
|
|
@ -578,6 +578,8 @@ initoperator(void)
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule4("operator", operator_methods, operator_doc,
|
m = Py_InitModule4("operator", operator_methods, operator_doc,
|
||||||
(PyObject*)NULL, PYTHON_API_VERSION);
|
(PyObject*)NULL, PYTHON_API_VERSION);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (PyType_Ready(&itemgetter_type) < 0)
|
if (PyType_Ready(&itemgetter_type) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -963,6 +963,8 @@ initossaudiodev(void)
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
|
|
||||||
m = Py_InitModule("ossaudiodev", ossaudiodev_methods);
|
m = Py_InitModule("ossaudiodev", ossaudiodev_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
OSSAudioError = PyErr_NewException("ossaudiodev.OSSAudioError",
|
OSSAudioError = PyErr_NewException("ossaudiodev.OSSAudioError",
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
|
@ -3148,6 +3148,8 @@ initparser(void)
|
||||||
|
|
||||||
PyST_Type.ob_type = &PyType_Type;
|
PyST_Type.ob_type = &PyType_Type;
|
||||||
module = Py_InitModule("parser", parser_functions);
|
module = Py_InitModule("parser", parser_functions);
|
||||||
|
if (module == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (parser_error == 0)
|
if (parser_error == 0)
|
||||||
parser_error = PyErr_NewException("parser.ParserError", NULL, NULL);
|
parser_error = PyErr_NewException("parser.ParserError", NULL, NULL);
|
||||||
|
|
|
@ -7967,6 +7967,8 @@ INITFUNC(void)
|
||||||
m = Py_InitModule3(MODNAME,
|
m = Py_InitModule3(MODNAME,
|
||||||
posix_methods,
|
posix_methods,
|
||||||
posix__doc__);
|
posix__doc__);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Initialize environ dictionary */
|
/* Initialize environ dictionary */
|
||||||
v = convertenviron();
|
v = convertenviron();
|
||||||
|
|
|
@ -952,6 +952,8 @@ initpure()
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
|
|
||||||
m = Py_InitModule("pure", pure_methods);
|
m = Py_InitModule("pure", pure_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
/* this is bogus because we should be able to find this information
|
/* this is bogus because we should be able to find this information
|
||||||
|
|
|
@ -183,6 +183,8 @@ initpwd(void)
|
||||||
{
|
{
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
m = Py_InitModule3("pwd", pwd_methods, pwd__doc__);
|
m = Py_InitModule3("pwd", pwd_methods, pwd__doc__);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
PyStructSequence_InitType(&StructPwdType, &struct_pwd_type_desc);
|
PyStructSequence_InitType(&StructPwdType, &struct_pwd_type_desc);
|
||||||
Py_INCREF((PyObject *) &StructPwdType);
|
Py_INCREF((PyObject *) &StructPwdType);
|
||||||
|
|
|
@ -1854,6 +1854,8 @@ MODULE_INITFUNC(void)
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule3(MODULE_NAME, pyexpat_methods,
|
m = Py_InitModule3(MODULE_NAME, pyexpat_methods,
|
||||||
pyexpat_module_documentation);
|
pyexpat_module_documentation);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
if (ErrorObject == NULL) {
|
if (ErrorObject == NULL) {
|
||||||
|
|
|
@ -925,6 +925,8 @@ initreadline(void)
|
||||||
|
|
||||||
m = Py_InitModule4("readline", readline_methods, doc_module,
|
m = Py_InitModule4("readline", readline_methods, doc_module,
|
||||||
(PyObject *)NULL, PYTHON_API_VERSION);
|
(PyObject *)NULL, PYTHON_API_VERSION);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
PyOS_ReadlineFunctionPointer = call_readline;
|
PyOS_ReadlineFunctionPointer = call_readline;
|
||||||
setup_readline();
|
setup_readline();
|
||||||
|
|
|
@ -653,6 +653,8 @@ initregex(void)
|
||||||
Regextype.ob_type = &PyType_Type;
|
Regextype.ob_type = &PyType_Type;
|
||||||
|
|
||||||
m = Py_InitModule("regex", regex_global_methods);
|
m = Py_InitModule("regex", regex_global_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
if (PyErr_Warn(PyExc_DeprecationWarning,
|
if (PyErr_Warn(PyExc_DeprecationWarning,
|
||||||
|
|
|
@ -234,6 +234,8 @@ initresource(void)
|
||||||
|
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule("resource", resource_methods);
|
m = Py_InitModule("resource", resource_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
if (ResourceError == NULL) {
|
if (ResourceError == NULL) {
|
||||||
|
|
|
@ -756,6 +756,8 @@ initrgbimg(void)
|
||||||
{
|
{
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
m = Py_InitModule("rgbimg", rgbimg_methods);
|
m = Py_InitModule("rgbimg", rgbimg_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
ImgfileError = PyErr_NewException("rgbimg.error", NULL, NULL);
|
ImgfileError = PyErr_NewException("rgbimg.error", NULL, NULL);
|
||||||
if (ImgfileError != NULL)
|
if (ImgfileError != NULL)
|
||||||
|
|
|
@ -662,6 +662,8 @@ initselect(void)
|
||||||
{
|
{
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
m = Py_InitModule3("select", select_methods, module_doc);
|
m = Py_InitModule3("select", select_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
SelectError = PyErr_NewException("select.error", NULL, NULL);
|
SelectError = PyErr_NewException("select.error", NULL, NULL);
|
||||||
Py_INCREF(SelectError);
|
Py_INCREF(SelectError);
|
||||||
|
|
|
@ -706,4 +706,6 @@ init_sha256(void)
|
||||||
if (PyType_Ready(&SHA256type) < 0)
|
if (PyType_Ready(&SHA256type) < 0)
|
||||||
return;
|
return;
|
||||||
m = Py_InitModule("_sha256", SHA_functions);
|
m = Py_InitModule("_sha256", SHA_functions);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -772,6 +772,8 @@ init_sha512(void)
|
||||||
if (PyType_Ready(&SHA512type) < 0)
|
if (PyType_Ready(&SHA512type) < 0)
|
||||||
return;
|
return;
|
||||||
m = Py_InitModule("_sha512", SHA_functions);
|
m = Py_InitModule("_sha512", SHA_functions);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -590,6 +590,8 @@ init_sha(void)
|
||||||
if (PyType_Ready(&SHAtype) < 0)
|
if (PyType_Ready(&SHAtype) < 0)
|
||||||
return;
|
return;
|
||||||
m = Py_InitModule("_sha", SHA_functions);
|
m = Py_InitModule("_sha", SHA_functions);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
insint("blocksize", 1); /* For future use, in case some hash
|
insint("blocksize", 1); /* For future use, in case some hash
|
||||||
|
|
|
@ -317,6 +317,8 @@ initsignal(void)
|
||||||
|
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule3("signal", signal_methods, module_doc);
|
m = Py_InitModule3("signal", signal_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
|
@ -3871,6 +3871,8 @@ init_socket(void)
|
||||||
m = Py_InitModule3(PySocket_MODULE_NAME,
|
m = Py_InitModule3(PySocket_MODULE_NAME,
|
||||||
socket_methods,
|
socket_methods,
|
||||||
socket_doc);
|
socket_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
socket_error = PyErr_NewException("socket.error", NULL, NULL);
|
socket_error = PyErr_NewException("socket.error", NULL, NULL);
|
||||||
if (socket_error == NULL)
|
if (socket_error == NULL)
|
||||||
|
|
|
@ -171,6 +171,8 @@ initspwd(void)
|
||||||
{
|
{
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
m=Py_InitModule3("spwd", spwd_methods, spwd__doc__);
|
m=Py_InitModule3("spwd", spwd_methods, spwd__doc__);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
PyStructSequence_InitType(&StructSpwdType, &struct_spwd_type_desc);
|
PyStructSequence_InitType(&StructSpwdType, &struct_spwd_type_desc);
|
||||||
Py_INCREF((PyObject *) &StructSpwdType);
|
Py_INCREF((PyObject *) &StructSpwdType);
|
||||||
PyModule_AddObject(m, "struct_spwd", (PyObject *) &StructSpwdType);
|
PyModule_AddObject(m, "struct_spwd", (PyObject *) &StructSpwdType);
|
||||||
|
|
|
@ -1210,6 +1210,8 @@ initstrop(void)
|
||||||
int c, n;
|
int c, n;
|
||||||
m = Py_InitModule4("strop", strop_methods, strop_module__doc__,
|
m = Py_InitModule4("strop", strop_methods, strop_module__doc__,
|
||||||
(PyObject*)NULL, PYTHON_API_VERSION);
|
(PyObject*)NULL, PYTHON_API_VERSION);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Create 'whitespace' object */
|
/* Create 'whitespace' object */
|
||||||
n = 0;
|
n = 0;
|
||||||
|
|
|
@ -1278,6 +1278,8 @@ initstruct(void)
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule4("struct", struct_methods, struct__doc__,
|
m = Py_InitModule4("struct", struct_methods, struct__doc__,
|
||||||
(PyObject*)NULL, PYTHON_API_VERSION);
|
(PyObject*)NULL, PYTHON_API_VERSION);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
if (StructError == NULL) {
|
if (StructError == NULL) {
|
||||||
|
|
|
@ -456,6 +456,8 @@ initsunaudiodev(void)
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
|
|
||||||
m = Py_InitModule("sunaudiodev", sunaudiodev_methods);
|
m = Py_InitModule("sunaudiodev", sunaudiodev_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
SunAudioError = PyErr_NewException("sunaudiodev.error", NULL, NULL);
|
SunAudioError = PyErr_NewException("sunaudiodev.error", NULL, NULL);
|
||||||
if (SunAudioError)
|
if (SunAudioError)
|
||||||
|
|
|
@ -956,6 +956,8 @@ initsv(void)
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
|
|
||||||
m = Py_InitModule("sv", sv_methods);
|
m = Py_InitModule("sv", sv_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
SvError = PyErr_NewException("sv.error", NULL, NULL);
|
SvError = PyErr_NewException("sv.error", NULL, NULL);
|
||||||
|
|
|
@ -53,6 +53,8 @@ init_symtable(void)
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
|
|
||||||
m = Py_InitModule("_symtable", symtable_methods);
|
m = Py_InitModule("_symtable", symtable_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
PyModule_AddIntConstant(m, "USE", USE);
|
PyModule_AddIntConstant(m, "USE", USE);
|
||||||
PyModule_AddIntConstant(m, "DEF_GLOBAL", DEF_GLOBAL);
|
PyModule_AddIntConstant(m, "DEF_GLOBAL", DEF_GLOBAL);
|
||||||
PyModule_AddIntConstant(m, "DEF_LOCAL", DEF_LOCAL);
|
PyModule_AddIntConstant(m, "DEF_LOCAL", DEF_LOCAL);
|
||||||
|
|
|
@ -163,6 +163,8 @@ initsyslog(void)
|
||||||
|
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule("syslog", syslog_methods);
|
m = Py_InitModule("syslog", syslog_methods);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
|
|
||||||
|
|
|
@ -910,6 +910,8 @@ PyInit_termios(void)
|
||||||
|
|
||||||
m = Py_InitModule4("termios", termios_methods, termios__doc__,
|
m = Py_InitModule4("termios", termios_methods, termios__doc__,
|
||||||
(PyObject *)NULL, PYTHON_API_VERSION);
|
(PyObject *)NULL, PYTHON_API_VERSION);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (TermiosError == NULL) {
|
if (TermiosError == NULL) {
|
||||||
TermiosError = PyErr_NewException("termios.error", NULL, NULL);
|
TermiosError = PyErr_NewException("termios.error", NULL, NULL);
|
||||||
|
|
|
@ -638,6 +638,8 @@ initthread(void)
|
||||||
|
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule3("thread", thread_methods, thread_doc);
|
m = Py_InitModule3("thread", thread_methods, thread_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add a symbolic constant */
|
/* Add a symbolic constant */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
|
@ -785,6 +785,8 @@ inittime(void)
|
||||||
PyObject *m;
|
PyObject *m;
|
||||||
char *p;
|
char *p;
|
||||||
m = Py_InitModule3("time", time_methods, module_doc);
|
m = Py_InitModule3("time", time_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Accept 2-digit dates unless PYTHONY2K is set and non-empty */
|
/* Accept 2-digit dates unless PYTHONY2K is set and non-empty */
|
||||||
p = Py_GETENV("PYTHONY2K");
|
p = Py_GETENV("PYTHONY2K");
|
||||||
|
|
|
@ -352,6 +352,8 @@ initxx(void)
|
||||||
|
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule3("xx", xx_methods, module_doc);
|
m = Py_InitModule3("xx", xx_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
if (ErrorObject == NULL) {
|
if (ErrorObject == NULL) {
|
||||||
|
|
|
@ -878,6 +878,8 @@ PyInit_zlib(void)
|
||||||
m = Py_InitModule4("zlib", zlib_methods,
|
m = Py_InitModule4("zlib", zlib_methods,
|
||||||
zlib_module_documentation,
|
zlib_module_documentation,
|
||||||
(PyObject*)NULL,PYTHON_API_VERSION);
|
(PyObject*)NULL,PYTHON_API_VERSION);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
ZlibError = PyErr_NewException("zlib.error", NULL, NULL);
|
ZlibError = PyErr_NewException("zlib.error", NULL, NULL);
|
||||||
if (ZlibError != NULL) {
|
if (ZlibError != NULL) {
|
||||||
|
|
|
@ -553,6 +553,8 @@ init_subprocess()
|
||||||
sp_handle_as_number.nb_int = (unaryfunc) sp_handle_as_int;
|
sp_handle_as_number.nb_int = (unaryfunc) sp_handle_as_int;
|
||||||
|
|
||||||
m = Py_InitModule("_subprocess", sp_functions);
|
m = Py_InitModule("_subprocess", sp_functions);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
/* constants */
|
/* constants */
|
||||||
|
|
|
@ -1459,6 +1459,8 @@ PyMODINIT_FUNC init_winreg(void)
|
||||||
{
|
{
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
m = Py_InitModule3("_winreg", winreg_methods, module_doc);
|
m = Py_InitModule3("_winreg", winreg_methods, module_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
PyHKEY_Type.ob_type = &PyType_Type;
|
PyHKEY_Type.ob_type = &PyType_Type;
|
||||||
PyHKEY_Type.tp_doc = PyHKEY_doc;
|
PyHKEY_Type.tp_doc = PyHKEY_doc;
|
||||||
|
|
|
@ -221,6 +221,8 @@ PyMODINIT_FUNC
|
||||||
initmsvcrt(void)
|
initmsvcrt(void)
|
||||||
{
|
{
|
||||||
PyObject *m = Py_InitModule("msvcrt", msvcrt_functions);
|
PyObject *m = Py_InitModule("msvcrt", msvcrt_functions);
|
||||||
|
if (m == NULL)
|
||||||
|
return;
|
||||||
PyObject *d = PyModule_GetDict(m);
|
PyObject *d = PyModule_GetDict(m);
|
||||||
|
|
||||||
/* constants for the locking() function's mode argument */
|
/* constants for the locking() function's mode argument */
|
||||||
|
|
|
@ -220,6 +220,8 @@ initwinsound(void)
|
||||||
PyObject *module = Py_InitModule3("winsound",
|
PyObject *module = Py_InitModule3("winsound",
|
||||||
sound_methods,
|
sound_methods,
|
||||||
sound_module_doc);
|
sound_module_doc);
|
||||||
|
if (module == NULL)
|
||||||
|
return;
|
||||||
PyObject *dict = PyModule_GetDict(module);
|
PyObject *dict = PyModule_GetDict(module);
|
||||||
|
|
||||||
ADD_DEFINE(SND_ASYNC);
|
ADD_DEFINE(SND_ASYNC);
|
||||||
|
|
|
@ -2817,6 +2817,8 @@ initimp(void)
|
||||||
|
|
||||||
m = Py_InitModule4("imp", imp_methods, doc_imp,
|
m = Py_InitModule4("imp", imp_methods, doc_imp,
|
||||||
NULL, PYTHON_API_VERSION);
|
NULL, PYTHON_API_VERSION);
|
||||||
|
if (m == NULL)
|
||||||
|
goto failure;
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
if (setint(d, "SEARCH_ERROR", SEARCH_ERROR) < 0) goto failure;
|
if (setint(d, "SEARCH_ERROR", SEARCH_ERROR) < 0) goto failure;
|
||||||
|
|
|
@ -1107,5 +1107,7 @@ PyMODINIT_FUNC
|
||||||
PyMarshal_Init(void)
|
PyMarshal_Init(void)
|
||||||
{
|
{
|
||||||
PyObject *mod = Py_InitModule("marshal", marshal_methods);
|
PyObject *mod = Py_InitModule("marshal", marshal_methods);
|
||||||
|
if (mod == NULL)
|
||||||
|
return;
|
||||||
PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION);
|
PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1027,6 +1027,8 @@ _PySys_Init(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m = Py_InitModule3("sys", sys_methods, sys_doc);
|
m = Py_InitModule3("sys", sys_methods, sys_doc);
|
||||||
|
if (m == NULL)
|
||||||
|
return NULL;
|
||||||
sysdict = PyModule_GetDict(m);
|
sysdict = PyModule_GetDict(m);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue