summaryrefslogtreecommitdiffstats
path: root/Objects/memoryobject.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-05-26 13:22:05 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-05-26 13:22:05 (GMT)
commit9c4756ea265b5ebd71c9ae59f3673c7cecb6f060 (patch)
tree642b21e774a9cb2d949e10ce65e7d10326c70138 /Objects/memoryobject.c
parent96d02f3c1e145821cd5ce8817d4263e7d8d57e4a (diff)
downloadcpython-9c4756ea265b5ebd71c9ae59f3673c7cecb6f060.zip
cpython-9c4756ea265b5ebd71c9ae59f3673c7cecb6f060.tar.gz
cpython-9c4756ea265b5ebd71c9ae59f3673c7cecb6f060.tar.bz2
Renamed PyBytes to PyByteArray
Diffstat (limited to 'Objects/memoryobject.c')
-rw-r--r--Objects/memoryobject.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index c60c53c..27ceb7a 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -254,12 +254,12 @@ PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort)
"for a non-contiguousobject.");
return NULL;
}
- bytes = PyBytes_FromStringAndSize(NULL, view->len);
+ bytes = PyByteArray_FromStringAndSize(NULL, view->len);
if (bytes == NULL) {
PyObject_ReleaseBuffer(obj, view);
return NULL;
}
- dest = PyBytes_AS_STRING(bytes);
+ dest = PyByteArray_AS_STRING(bytes);
/* different copying strategy depending on whether
or not any pointer de-referencing is needed
*/
@@ -382,7 +382,7 @@ static PyGetSetDef memory_getsetlist[] ={
static PyObject *
memory_tobytes(PyMemoryViewObject *mem, PyObject *noargs)
{
- return PyBytes_FromObject((PyObject *)mem);
+ return PyByteArray_FromObject((PyObject *)mem);
}
static PyObject *
@@ -451,8 +451,8 @@ memory_str(PyMemoryViewObject *self)
if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0)
return NULL;
- res = PyBytes_FromStringAndSize(NULL, view.len);
- PyBuffer_ToContiguous(PyBytes_AS_STRING(res), &view, view.len, 'C');
+ res = PyByteArray_FromStringAndSize(NULL, view.len);
+ PyBuffer_ToContiguous(PyByteArray_AS_STRING(res), &view, view.len, 'C');
PyObject_ReleaseBuffer((PyObject *)self, &view);
return res;
}
@@ -522,7 +522,7 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key)
{
ptr = *((char **)ptr) + view->suboffsets[0];
}
- return PyBytes_FromStringAndSize(ptr, view->itemsize);
+ return PyByteArray_FromStringAndSize(ptr, view->itemsize);
}
else {
/* Return a new memory-view object */