diff Modules/arraymodule.c @ 47301:23ab586c427a

Renamed PyString to PyBytes
author Christian Heimes <christian@cheimes.de>
date Mon, 26 May 2008 13:28:38 +0000
parents 96b34263e448
children a0193b08f0eb
line wrap: on
line diff
--- a/Modules/arraymodule.c	Mon May 26 13:22:05 2008 +0000
+++ b/Modules/arraymodule.c	Mon May 26 13:28:38 2008 +0000
@@ -1212,14 +1212,14 @@
 	if (b == NULL)
 		return NULL;
 
-	if (!PyString_Check(b)) {
+	if (!PyBytes_Check(b)) {
 		PyErr_SetString(PyExc_TypeError,
 				"read() didn't return bytes");
 		Py_DECREF(b);
 		return NULL;
 	}
 
-	if (PyString_GET_SIZE(b) != nbytes) {
+	if (PyBytes_GET_SIZE(b) != nbytes) {
 		PyErr_SetString(PyExc_EOFError,
 				"read() didn't return enough bytes");
 		Py_DECREF(b);
@@ -1263,7 +1263,7 @@
 		PyObject *bytes, *res;
 		if (i*BLOCKSIZE + size > nbytes)
 			size = nbytes - i*BLOCKSIZE;
-		bytes = PyString_FromStringAndSize(ptr, size);
+		bytes = PyBytes_FromStringAndSize(ptr, size);
 		if (bytes == NULL)
 			return NULL;
 		res = PyObject_CallMethod(f, "write", "O", bytes);
@@ -1394,7 +1394,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);
 }
 
@@ -1856,7 +1856,7 @@
 
 	if (!(initial == NULL || PyList_Check(initial)
 	      || PyByteArray_Check(initial)
-	      || PyString_Check(initial)
+	      || PyBytes_Check(initial)
 	      || PyTuple_Check(initial)
 	      || ((c=='u') && PyUnicode_Check(initial)))) {
 		it = PyObject_GetIter(initial);
@@ -1902,7 +1902,7 @@
 				}
 			}
 			else if (initial != NULL && (PyByteArray_Check(initial) ||
-					   PyString_Check(initial))) {
+					   PyBytes_Check(initial))) {
 				PyObject *t_initial, *v;
 				t_initial = PyTuple_Pack(1, initial);
 				if (t_initial == NULL) {