[Python-checkins] r68641 - sandbox/trunk/io-c/_textio.c

antoine.pitrou python-checkins at python.org
Sat Jan 17 01:54:59 CET 2009


Author: antoine.pitrou
Date: Sat Jan 17 01:54:59 2009
New Revision: 68641

Log:
Don't forget to clear the err status if we fail to import the locale module.
This solves a bunch of (bootstrap-related) test failures in the regression suite here.



Modified:
   sandbox/trunk/io-c/_textio.c

Modified: sandbox/trunk/io-c/_textio.c
==============================================================================
--- sandbox/trunk/io-c/_textio.c	(original)
+++ sandbox/trunk/io-c/_textio.c	Sat Jan 17 01:54:59 2009
@@ -647,6 +647,7 @@
         /* try locale.getpreferredencoding() */
         PyObject *locale = PyImport_ImportModule("locale");
         if (locale == NULL) {
+            PyErr_Clear();
             self->encoding = PyUnicode_FromString("ascii");
         }
         else {


More information about the Python-checkins mailing list