Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 19295:157bbb896198 legacy-trunk
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.)
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 16 Aug 2001 08:21:42 +0000 |
| parents | e110cd4fc3c6 |
| children | 1069090b124e |
comparison
equal
deleted
inserted
replaced
| 19294:1456ec735087 | 19295:157bbb896198 |
|---|---|
| 92 { | 92 { |
| 93 PyInterpreterState *interp; | 93 PyInterpreterState *interp; |
| 94 PyThreadState *tstate; | 94 PyThreadState *tstate; |
| 95 PyObject *bimod, *sysmod; | 95 PyObject *bimod, *sysmod; |
| 96 char *p; | 96 char *p; |
| 97 extern void _Py_ReadyTypes(void); | |
| 97 | 98 |
| 98 if (initialized) | 99 if (initialized) |
| 99 return; | 100 return; |
| 100 initialized = 1; | 101 initialized = 1; |
| 101 | 102 |
| 113 tstate = PyThreadState_New(interp); | 114 tstate = PyThreadState_New(interp); |
| 114 if (tstate == NULL) | 115 if (tstate == NULL) |
| 115 Py_FatalError("Py_Initialize: can't make first thread"); | 116 Py_FatalError("Py_Initialize: can't make first thread"); |
| 116 (void) PyThreadState_Swap(tstate); | 117 (void) PyThreadState_Swap(tstate); |
| 117 | 118 |
| 118 if (PyType_Ready(&PyType_Type) < 0) | 119 _Py_ReadyTypes(); |
| 119 Py_FatalError("Py_Initialize: can't initialize 'type'"); | |
| 120 | |
| 121 if (PyType_Ready(&PyList_Type) < 0) | |
| 122 Py_FatalError("Py_Initialize: can't initialize 'list'"); | |
| 123 | 120 |
| 124 interp->modules = PyDict_New(); | 121 interp->modules = PyDict_New(); |
| 125 if (interp->modules == NULL) | 122 if (interp->modules == NULL) |
| 126 Py_FatalError("Py_Initialize: can't make modules dictionary"); | 123 Py_FatalError("Py_Initialize: can't make modules dictionary"); |
| 127 | 124 |
| 153 _PyExc_Init(); | 150 _PyExc_Init(); |
| 154 _PyImport_FixupExtension("exceptions", "exceptions"); | 151 _PyImport_FixupExtension("exceptions", "exceptions"); |
| 155 | 152 |
| 156 /* phase 2 of builtins */ | 153 /* phase 2 of builtins */ |
| 157 _PyImport_FixupExtension("__builtin__", "__builtin__"); | 154 _PyImport_FixupExtension("__builtin__", "__builtin__"); |
| 155 _PyImport_FixupExtension("exceptions", "exceptions"); | |
| 158 | 156 |
| 159 initsigs(); /* Signal handling stuff, including initintr() */ | 157 initsigs(); /* Signal handling stuff, including initintr() */ |
| 160 | 158 |
| 161 initmain(); /* Module __main__ */ | 159 initmain(); /* Module __main__ */ |
| 162 if (!Py_NoSiteFlag) | 160 if (!Py_NoSiteFlag) |
| 1324 { | 1322 { |
| 1325 #ifdef HAVE_SIGNAL_H | 1323 #ifdef HAVE_SIGNAL_H |
| 1326 #ifdef SIGPIPE | 1324 #ifdef SIGPIPE |
| 1327 signal(SIGPIPE, SIG_IGN); | 1325 signal(SIGPIPE, SIG_IGN); |
| 1328 #endif | 1326 #endif |
| 1327 #ifdef SIGXFZ | |
| 1328 signal(SIGXFZ, SIG_IGN); | |
| 1329 #endif | |
| 1329 #endif /* HAVE_SIGNAL_H */ | 1330 #endif /* HAVE_SIGNAL_H */ |
| 1330 PyOS_InitInterrupts(); /* May imply initsignal() */ | 1331 PyOS_InitInterrupts(); /* May imply initsignal() */ |
| 1331 } | 1332 } |
| 1332 | 1333 |
| 1333 #ifdef Py_TRACE_REFS | 1334 #ifdef Py_TRACE_REFS |
