[Python-checkins] python/dist/src/Modules _codecsmodule.c, 2.20, 2.20.2.1 _tkinter.c, 1.168, 1.168.2.1

loewis at users.sourceforge.net loewis at users.sourceforge.net
Tue Mar 8 16:05:25 CET 2005


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26176/Modules

Modified Files:
      Tag: release24-maint
	_codecsmodule.c _tkinter.c 
Log Message:
Build with --disable-unicode again. Fixes #1158607.


Index: _codecsmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_codecsmodule.c,v
retrieving revision 2.20
retrieving revision 2.20.2.1
diff -u -d -r2.20 -r2.20.2.1
--- _codecsmodule.c	7 Sep 2004 20:24:22 -0000	2.20
+++ _codecsmodule.c	8 Mar 2005 15:05:17 -0000	2.20.2.1
@@ -104,8 +104,15 @@
     if (!PyArg_ParseTuple(args, "O|ss:encode", &v, &encoding, &errors))
         return NULL;
 
+#ifdef Py_USING_UNICODE
     if (encoding == NULL)
 	encoding = PyUnicode_GetDefaultEncoding();
+#else
+    if (encoding == NULL) {
+	PyErr_SetString(PyExc_ValueError, "no encoding specified");
+	return NULL;
+    }
+#endif
 
     /* Encode via the codec registry */
     v = PyCodec_Encode(v, encoding, errors);
@@ -137,8 +144,15 @@
     if (!PyArg_ParseTuple(args, "O|ss:decode", &v, &encoding, &errors))
         return NULL;
 
+#ifdef Py_USING_UNICODE
     if (encoding == NULL)
 	encoding = PyUnicode_GetDefaultEncoding();
+#else
+    if (encoding == NULL) {
+	PyErr_SetString(PyExc_ValueError, "no encoding specified");
+	return NULL;
+    }
+#endif
 
     /* Decode via the codec registry */
     v = PyCodec_Decode(v, encoding, errors);

Index: _tkinter.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v
retrieving revision 1.168
retrieving revision 1.168.2.1
diff -u -d -r1.168 -r1.168.2.1
--- _tkinter.c	13 Nov 2004 11:13:35 -0000	1.168
+++ _tkinter.c	8 Mar 2005 15:05:18 -0000	1.168.2.1
@@ -838,8 +838,10 @@
 };
 
 static PyMethodDef PyTclObject_methods[] = {
+#ifdef Py_USING_UNICODE
 	{"__unicode__",	(PyCFunction)PyTclObject_unicode, METH_NOARGS,
 	PyTclObject_unicode__doc__},
+#endif
 	{0}
 };
 
@@ -991,7 +993,7 @@
 			}
 		}
 #else
-		res = PyString_FromStringAndSize(value->bytes, value->length);
+		result = PyString_FromStringAndSize(value->bytes, value->length);
 #endif
 		return result;
 	}



More information about the Python-checkins mailing list