comparison Python/pythonrun.c @ 41587:15b810e21fe9

Get rid of all #ifdef Py_USING_UNICODE (it is always present now). (With the help of unifdef from freshmeat.)
author Guido van Rossum <guido@python.org>
date Thu, 03 May 2007 17:49:24 +0000
parents 29ae667f3239
children cd125fe83051
comparison
equal deleted inserted replaced
41586:368fed9af761 41587:15b810e21fe9
150 { 150 {
151 PyInterpreterState *interp; 151 PyInterpreterState *interp;
152 PyThreadState *tstate; 152 PyThreadState *tstate;
153 PyObject *bimod, *sysmod; 153 PyObject *bimod, *sysmod;
154 char *p; 154 char *p;
155 #if defined(Py_USING_UNICODE) && defined(HAVE_LANGINFO_H) && defined(CODESET) 155 #if defined(HAVE_LANGINFO_H) && defined(CODESET)
156 char *codeset; 156 char *codeset;
157 char *saved_locale; 157 char *saved_locale;
158 PyObject *sys_stream, *sys_isatty; 158 PyObject *sys_stream, *sys_isatty;
159 #endif 159 #endif
160 extern void _Py_ReadyTypes(void); 160 extern void _Py_ReadyTypes(void);
197 Py_FatalError("Py_Initialize: can't make modules dictionary"); 197 Py_FatalError("Py_Initialize: can't make modules dictionary");
198 interp->modules_reloading = PyDict_New(); 198 interp->modules_reloading = PyDict_New();
199 if (interp->modules_reloading == NULL) 199 if (interp->modules_reloading == NULL)
200 Py_FatalError("Py_Initialize: can't make modules_reloading dictionary"); 200 Py_FatalError("Py_Initialize: can't make modules_reloading dictionary");
201 201
202 #ifdef Py_USING_UNICODE
203 /* Init Unicode implementation; relies on the codec registry */ 202 /* Init Unicode implementation; relies on the codec registry */
204 _PyUnicode_Init(); 203 _PyUnicode_Init();
205 #endif
206 204
207 bimod = _PyBuiltin_Init(); 205 bimod = _PyBuiltin_Init();
208 if (bimod == NULL) 206 if (bimod == NULL)
209 Py_FatalError("Py_Initialize: can't initialize __builtin__"); 207 Py_FatalError("Py_Initialize: can't initialize __builtin__");
210 interp->builtins = PyModule_GetDict(bimod); 208 interp->builtins = PyModule_GetDict(bimod);
248 246
249 warnings_module = PyImport_ImportModule("warnings"); 247 warnings_module = PyImport_ImportModule("warnings");
250 if (!warnings_module) 248 if (!warnings_module)
251 PyErr_Clear(); 249 PyErr_Clear();
252 250
253 #if defined(Py_USING_UNICODE) && defined(HAVE_LANGINFO_H) && defined(CODESET) 251 #if defined(HAVE_LANGINFO_H) && defined(CODESET)
254 /* On Unix, set the file system encoding according to the 252 /* On Unix, set the file system encoding according to the
255 user's preference, if the CODESET names a well-known 253 user's preference, if the CODESET names a well-known
256 Python codec, and Py_FileSystemDefaultEncoding isn't 254 Python codec, and Py_FileSystemDefaultEncoding isn't
257 initialized by other means. Also set the encoding of 255 initialized by other means. Also set the encoding of
258 stdin and stdout if these are terminals. */ 256 stdin and stdout if these are terminals. */
466 PyString_Fini(); 464 PyString_Fini();
467 PyBytes_Fini(); 465 PyBytes_Fini();
468 PyLong_Fini(); 466 PyLong_Fini();
469 PyFloat_Fini(); 467 PyFloat_Fini();
470 468
471 #ifdef Py_USING_UNICODE
472 /* Cleanup Unicode implementation */ 469 /* Cleanup Unicode implementation */
473 _PyUnicode_Fini(); 470 _PyUnicode_Fini();
474 #endif
475 471
476 /* XXX Still allocated: 472 /* XXX Still allocated:
477 - various static ad-hoc pointers to interned strings 473 - various static ad-hoc pointers to interned strings
478 - int and float free list blocks 474 - int and float free list blocks
479 - whatever various modules and libraries allocate 475 - whatever various modules and libraries allocate