Mercurial > cpython-lru_cache-weakref
diff 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 |
line wrap: on
line diff
--- a/Python/pythonrun.c Fri Mar 10 23:03:02 2000 +0000 +++ b/Python/pythonrun.c Fri Mar 10 23:03:54 2000 +0000 @@ -76,6 +76,12 @@ int _Py_AskYesNo(char *prompt); #endif +extern void _PyUnicode_Init(); +extern void _PyUnicode_Fini(); +extern void _PyCodecRegistry_Init(); +extern void _PyCodecRegistry_Fini(); + + int Py_DebugFlag; /* Needed by parser.c */ int Py_VerboseFlag; /* Needed by import.c */ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */ @@ -137,6 +143,12 @@ if (interp->modules == NULL) Py_FatalError("Py_Initialize: can't make modules dictionary"); + /* Init codec registry */ + _PyCodecRegistry_Init(); + + /* Init Unicode implementation; relies on the codec registry */ + _PyUnicode_Init(); + bimod = _PyBuiltin_Init_1(); if (bimod == NULL) Py_FatalError("Py_Initialize: can't initialize __builtin__"); @@ -206,6 +218,12 @@ /* Destroy PyExc_MemoryErrorInst */ _PyBuiltin_Fini_1(); + /* Cleanup Unicode implementation */ + _PyUnicode_Fini(); + + /* Cleanup Codec registry */ + _PyCodecRegistry_Fini(); + /* Destroy all modules */ PyImport_Cleanup();
