summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-03-10 23:03:54 (GMT)
committerGuido van Rossum <guido@python.org>2000-03-10 23:03:54 (GMT)
commitc94044c11d5e1f61443163d1c5ea44019d7c5871 (patch)
tree008c1f8f770ab847a332800c56ab3e6a84f86046
parentc279b53b4f010b0b296720c183cb78569812fbba (diff)
downloadcpython-c94044c11d5e1f61443163d1c5ea44019d7c5871.zip
cpython-c94044c11d5e1f61443163d1c5ea44019d7c5871.tar.gz
cpython-c94044c11d5e1f61443163d1c5ea44019d7c5871.tar.bz2
Marc-Andre Lemburg: add calls to initialize and finalize Unicode and
Codec registry.
-rw-r--r--Python/pythonrun.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 0814038..eb93d47 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -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();