Fix the array tests. Only a minor change to the C code was required.

This commit is contained in:
Guido van Rossum 2007-05-10 18:41:30 +00:00
parent bce56a6c5b
commit 1f05a3b7fb
2 changed files with 15 additions and 17 deletions

View file

@ -104,7 +104,9 @@ in bounds; that's the responsibility of the caller.
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