Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 28462:a8d6576b95af 2.2
Patch #710576: Implement per-interpreter-state codec registries.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Sun, 30 Mar 2003 20:57:31 +0000 |
| parents | f6e46585b6b3 |
| children |
comparison
equal
deleted
inserted
replaced
| 28457:804473cf7121 | 28462:a8d6576b95af |
|---|---|
| 47 int _Py_AskYesNo(char *prompt); | 47 int _Py_AskYesNo(char *prompt); |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 extern void _PyUnicode_Init(void); | 50 extern void _PyUnicode_Init(void); |
| 51 extern void _PyUnicode_Fini(void); | 51 extern void _PyUnicode_Fini(void); |
| 52 extern void _PyCodecRegistry_Init(void); | |
| 53 extern void _PyCodecRegistry_Fini(void); | |
| 54 | 52 |
| 55 int Py_DebugFlag; /* Needed by parser.c */ | 53 int Py_DebugFlag; /* Needed by parser.c */ |
| 56 int Py_VerboseFlag; /* Needed by import.c */ | 54 int Py_VerboseFlag; /* Needed by import.c */ |
| 57 int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */ | 55 int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */ |
| 58 int Py_NoSiteFlag; /* Suppress 'import site' */ | 56 int Py_NoSiteFlag; /* Suppress 'import site' */ |
| 131 | 129 |
| 132 interp->modules = PyDict_New(); | 130 interp->modules = PyDict_New(); |
| 133 if (interp->modules == NULL) | 131 if (interp->modules == NULL) |
| 134 Py_FatalError("Py_Initialize: can't make modules dictionary"); | 132 Py_FatalError("Py_Initialize: can't make modules dictionary"); |
| 135 | 133 |
| 136 /* Init codec registry */ | |
| 137 _PyCodecRegistry_Init(); | |
| 138 | |
| 139 #ifdef Py_USING_UNICODE | 134 #ifdef Py_USING_UNICODE |
| 140 /* Init Unicode implementation; relies on the codec registry */ | 135 /* Init Unicode implementation; relies on the codec registry */ |
| 141 _PyUnicode_Init(); | 136 _PyUnicode_Init(); |
| 142 #endif | 137 #endif |
| 143 | 138 |
| 216 tstate = PyThreadState_Get(); | 211 tstate = PyThreadState_Get(); |
| 217 interp = tstate->interp; | 212 interp = tstate->interp; |
| 218 | 213 |
| 219 /* Disable signal handling */ | 214 /* Disable signal handling */ |
| 220 PyOS_FiniInterrupts(); | 215 PyOS_FiniInterrupts(); |
| 221 | |
| 222 /* Cleanup Codec registry */ | |
| 223 _PyCodecRegistry_Fini(); | |
| 224 | 216 |
| 225 /* Destroy all modules */ | 217 /* Destroy all modules */ |
| 226 PyImport_Cleanup(); | 218 PyImport_Cleanup(); |
| 227 | 219 |
| 228 /* Destroy the database used by _PyImport_{Fixup,Find}Extension */ | 220 /* Destroy the database used by _PyImport_{Fixup,Find}Extension */ |
