mirror of https://github.com/python/cpython.git
Marc-Andre Lemburg: add calls to initialize and finalize Unicode and
Codec registry.
This commit is contained in:
parent
c279b53b4f
commit
c94044c11d
|
@ -76,6 +76,12 @@ static void call_ll_exitfuncs Py_PROTO((void));
|
|||
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 @@ Py_Initialize()
|
|||
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 @@ Py_Finalize()
|
|||
/* Destroy PyExc_MemoryErrorInst */
|
||||
_PyBuiltin_Fini_1();
|
||||
|
||||
/* Cleanup Unicode implementation */
|
||||
_PyUnicode_Fini();
|
||||
|
||||
/* Cleanup Codec registry */
|
||||
_PyCodecRegistry_Fini();
|
||||
|
||||
/* Destroy all modules */
|
||||
PyImport_Cleanup();
|
||||
|
||||
|
|
Loading…
Reference in New Issue