Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 11977:8b88e1bc0e1b legacy-trunk
Marc-Andre Lemburg: add calls to initialize and finalize Unicode and
Codec registry.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 10 Mar 2000 23:03:54 +0000 |
| parents | 5e6e9e893acd |
| children | ec6b6ca5d111 |
comparison
equal
deleted
inserted
replaced
| 11976:513354d87a85 | 11977:8b88e1bc0e1b |
|---|---|
| 74 | 74 |
| 75 #ifdef Py_TRACE_REFS | 75 #ifdef Py_TRACE_REFS |
| 76 int _Py_AskYesNo(char *prompt); | 76 int _Py_AskYesNo(char *prompt); |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 extern void _PyUnicode_Init(); | |
| 80 extern void _PyUnicode_Fini(); | |
| 81 extern void _PyCodecRegistry_Init(); | |
| 82 extern void _PyCodecRegistry_Fini(); | |
| 83 | |
| 84 | |
| 79 int Py_DebugFlag; /* Needed by parser.c */ | 85 int Py_DebugFlag; /* Needed by parser.c */ |
| 80 int Py_VerboseFlag; /* Needed by import.c */ | 86 int Py_VerboseFlag; /* Needed by import.c */ |
| 81 int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */ | 87 int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */ |
| 82 int Py_NoSiteFlag; /* Suppress 'import site' */ | 88 int Py_NoSiteFlag; /* Suppress 'import site' */ |
| 83 int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c */ | 89 int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c */ |
| 135 | 141 |
| 136 interp->modules = PyDict_New(); | 142 interp->modules = PyDict_New(); |
| 137 if (interp->modules == NULL) | 143 if (interp->modules == NULL) |
| 138 Py_FatalError("Py_Initialize: can't make modules dictionary"); | 144 Py_FatalError("Py_Initialize: can't make modules dictionary"); |
| 139 | 145 |
| 146 /* Init codec registry */ | |
| 147 _PyCodecRegistry_Init(); | |
| 148 | |
| 149 /* Init Unicode implementation; relies on the codec registry */ | |
| 150 _PyUnicode_Init(); | |
| 151 | |
| 140 bimod = _PyBuiltin_Init_1(); | 152 bimod = _PyBuiltin_Init_1(); |
| 141 if (bimod == NULL) | 153 if (bimod == NULL) |
| 142 Py_FatalError("Py_Initialize: can't initialize __builtin__"); | 154 Py_FatalError("Py_Initialize: can't initialize __builtin__"); |
| 143 interp->builtins = PyModule_GetDict(bimod); | 155 interp->builtins = PyModule_GetDict(bimod); |
| 144 Py_INCREF(interp->builtins); | 156 Py_INCREF(interp->builtins); |
| 203 /* Disable signal handling */ | 215 /* Disable signal handling */ |
| 204 PyOS_FiniInterrupts(); | 216 PyOS_FiniInterrupts(); |
| 205 | 217 |
| 206 /* Destroy PyExc_MemoryErrorInst */ | 218 /* Destroy PyExc_MemoryErrorInst */ |
| 207 _PyBuiltin_Fini_1(); | 219 _PyBuiltin_Fini_1(); |
| 220 | |
| 221 /* Cleanup Unicode implementation */ | |
| 222 _PyUnicode_Fini(); | |
| 223 | |
| 224 /* Cleanup Codec registry */ | |
| 225 _PyCodecRegistry_Fini(); | |
| 208 | 226 |
| 209 /* Destroy all modules */ | 227 /* Destroy all modules */ |
| 210 PyImport_Cleanup(); | 228 PyImport_Cleanup(); |
| 211 | 229 |
| 212 /* Destroy the database used by _PyImport_{Fixup,Find}Extension */ | 230 /* Destroy the database used by _PyImport_{Fixup,Find}Extension */ |
