mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Bunchathings:
- initsigs(): Ignore SIGXFZ so writing files beyond the file system size limit won't kill us. - Py_Initialize(): call _Py_ReadyTypes() instead of readying types here. - Py_Initialize(): call _PyImport_FixupExtension() for module "extensions". (SF bug #422004.)
This commit is contained in:
parent
ba21a49f9d
commit
70d893a6aa
1 changed files with 6 additions and 5 deletions
|
@ -94,6 +94,7 @@ Py_Initialize(void)
|
||||||
PyThreadState *tstate;
|
PyThreadState *tstate;
|
||||||
PyObject *bimod, *sysmod;
|
PyObject *bimod, *sysmod;
|
||||||
char *p;
|
char *p;
|
||||||
|
extern void _Py_ReadyTypes(void);
|
||||||
|
|
||||||
if (initialized)
|
if (initialized)
|
||||||
return;
|
return;
|
||||||
|
@ -115,11 +116,7 @@ Py_Initialize(void)
|
||||||
Py_FatalError("Py_Initialize: can't make first thread");
|
Py_FatalError("Py_Initialize: can't make first thread");
|
||||||
(void) PyThreadState_Swap(tstate);
|
(void) PyThreadState_Swap(tstate);
|
||||||
|
|
||||||
if (PyType_Ready(&PyType_Type) < 0)
|
_Py_ReadyTypes();
|
||||||
Py_FatalError("Py_Initialize: can't initialize 'type'");
|
|
||||||
|
|
||||||
if (PyType_Ready(&PyList_Type) < 0)
|
|
||||||
Py_FatalError("Py_Initialize: can't initialize 'list'");
|
|
||||||
|
|
||||||
interp->modules = PyDict_New();
|
interp->modules = PyDict_New();
|
||||||
if (interp->modules == NULL)
|
if (interp->modules == NULL)
|
||||||
|
@ -155,6 +152,7 @@ Py_Initialize(void)
|
||||||
|
|
||||||
/* phase 2 of builtins */
|
/* phase 2 of builtins */
|
||||||
_PyImport_FixupExtension("__builtin__", "__builtin__");
|
_PyImport_FixupExtension("__builtin__", "__builtin__");
|
||||||
|
_PyImport_FixupExtension("exceptions", "exceptions");
|
||||||
|
|
||||||
initsigs(); /* Signal handling stuff, including initintr() */
|
initsigs(); /* Signal handling stuff, including initintr() */
|
||||||
|
|
||||||
|
@ -1326,6 +1324,9 @@ initsigs(void)
|
||||||
#ifdef SIGPIPE
|
#ifdef SIGPIPE
|
||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef SIGXFZ
|
||||||
|
signal(SIGXFZ, SIG_IGN);
|
||||||
|
#endif
|
||||||
#endif /* HAVE_SIGNAL_H */
|
#endif /* HAVE_SIGNAL_H */
|
||||||
PyOS_InitInterrupts(); /* May imply initsignal() */
|
PyOS_InitInterrupts(); /* May imply initsignal() */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue