Mercurial > cpython-lru_cache-weakref
diff Modules/arraymodule.c @ 47294:4fe192d48960 legacy-trunk
Renamed PyString to PyBytes
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Mon, 26 May 2008 12:51:38 +0000 |
| parents | 7670005da8c5 |
| children | 52294af4b663 |
line wrap: on
line diff
--- a/Modules/arraymodule.c Mon May 26 12:29:46 2008 +0000 +++ b/Modules/arraymodule.c Mon May 26 12:51:38 2008 +0000 @@ -104,7 +104,7 @@ static PyObject * c_getitem(arrayobject *ap, Py_ssize_t i) { - return PyString_FromStringAndSize(&((char *)ap->ob_item)[i], 1); + return PyBytes_FromStringAndSize(&((char *)ap->ob_item)[i], 1); } static int @@ -1414,7 +1414,7 @@ static PyObject * array_tostring(arrayobject *self, PyObject *unused) { - return PyString_FromStringAndSize(self->ob_item, + return PyBytes_FromStringAndSize(self->ob_item, Py_SIZE(self) * self->ob_descr->itemsize); } @@ -1494,7 +1494,7 @@ array_get_typecode(arrayobject *a, void *closure) { char tc = a->ob_descr->typecode; - return PyString_FromStringAndSize(&tc, 1); + return PyBytes_FromStringAndSize(&tc, 1); } static PyObject * @@ -1578,7 +1578,7 @@ typecode = a->ob_descr->typecode; if (len == 0) { PyOS_snprintf(buf, sizeof(buf), "array('%c')", typecode); - return PyString_FromString(buf); + return PyBytes_FromString(buf); } if (typecode == 'c') @@ -1593,9 +1593,9 @@ Py_XDECREF(v); PyOS_snprintf(buf, sizeof(buf), "array('%c', ", typecode); - s = PyString_FromString(buf); - PyString_ConcatAndDel(&s, t); - PyString_ConcatAndDel(&s, PyString_FromString(")")); + s = PyBytes_FromString(buf); + PyBytes_ConcatAndDel(&s, t); + PyBytes_ConcatAndDel(&s, PyBytes_FromString(")")); return s; } @@ -1881,7 +1881,7 @@ return NULL; if (!(initial == NULL || PyList_Check(initial) - || PyString_Check(initial) || PyTuple_Check(initial) + || PyBytes_Check(initial) || PyTuple_Check(initial) || (c == 'u' && PyUnicode_Check(initial)))) { it = PyObject_GetIter(initial); if (it == NULL) @@ -1924,7 +1924,7 @@ } Py_DECREF(v); } - } else if (initial != NULL && PyString_Check(initial)) { + } else if (initial != NULL && PyBytes_Check(initial)) { PyObject *t_initial, *v; t_initial = PyTuple_Pack(1, initial); if (t_initial == NULL) {
