diff Modules/arraymodule.c @ 41685:bab8a9c7f49e

Fix the array tests. Only a minor change to the C code was required.
author Guido van Rossum <guido@python.org>
date Thu, 10 May 2007 18:41:30 +0000
parents 15b810e21fe9
children b29d71d43c80
line wrap: on
line diff
--- a/Modules/arraymodule.c	Thu May 10 18:04:33 2007 +0000
+++ b/Modules/arraymodule.c	Thu May 10 18:41:30 2007 +0000
@@ -104,7 +104,9 @@
 static PyObject *
 c_getitem(arrayobject *ap, Py_ssize_t i)
 {
-	return PyString_FromStringAndSize(&((char *)ap->ob_item)[i], 1);
+	Py_UNICODE buf[1];
+	buf[0] = ((unsigned char *)ap->ob_item)[i];
+	return PyUnicode_FromUnicode(buf, 1);
 }
 
 static int