mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Do the absolute minimal amount of modifications to eradicate
Py_FatalError() from module initialization functions. The importing mechanism already checks for PyErr_Occurred() after module importation and it Does The Right Thing. Unfortunately, the following either were not compiled or tested by the regression suite, due to issues with my development platform: almodule.c cdmodule.c mpzmodule.c puremodule.c timingmodule.c
This commit is contained in:
parent
72dacb8026
commit
9bfd2bf5ed
15 changed files with 31 additions and 67 deletions
|
@ -512,14 +512,15 @@ static PyMethodDef time_methods[] = {
|
|||
static void
|
||||
ins(PyObject *d, char *name, PyObject *v)
|
||||
{
|
||||
if (v == NULL)
|
||||
Py_FatalError("Can't initialize time module -- NULL value");
|
||||
if (PyDict_SetItemString(d, name, v) != 0)
|
||||
Py_FatalError(
|
||||
"Can't initialize time module -- PyDict_SetItemString failed");
|
||||
Py_DECREF(v);
|
||||
/* Don't worry too much about errors, they'll be caught by the
|
||||
* caller of inittime().
|
||||
*/
|
||||
if (v)
|
||||
PyDict_SetItemString(d, name, v);
|
||||
Py_XDECREF(v);
|
||||
}
|
||||
|
||||
|
||||
static char module_doc[] =
|
||||
"This module provides various functions to manipulate time values.\n\
|
||||
\n\
|
||||
|
@ -647,8 +648,6 @@ inittime(void)
|
|||
#endif /* macintosh */
|
||||
#endif /* HAVE_TM_ZONE */
|
||||
#endif /* !HAVE_TZNAME || __GLIBC__ */
|
||||
if (PyErr_Occurred())
|
||||
Py_FatalError("Can't initialize time module");
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue