mirror of https://github.com/python/cpython
Whitespace and line lengrth cleanup.
This commit is contained in:
parent
3f6d44e03e
commit
5dde61d0b9
|
@ -8,8 +8,8 @@ memory_getbuf(PyMemoryViewObject *self, Py_buffer *view, int flags)
|
|||
{
|
||||
if (view != NULL)
|
||||
*view = self->view;
|
||||
return self->base->ob_type->tp_as_buffer->bf_getbuffer(self->base,
|
||||
NULL, PyBUF_FULL);
|
||||
return self->base->ob_type->tp_as_buffer->bf_getbuffer(self->base, NULL,
|
||||
PyBUF_FULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -43,7 +43,7 @@ PyMemoryView_FromObject(PyObject *base)
|
|||
|
||||
if (!PyObject_CheckBuffer(base)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"cannot make memory view because object does "\
|
||||
"cannot make memory view because object does "
|
||||
"not have the buffer interface");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -240,8 +240,8 @@ PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort)
|
|||
if (buffertype == PyBUF_WRITE) {
|
||||
PyObject_DEL(mem);
|
||||
PyErr_SetString(PyExc_BufferError,
|
||||
"writable contiguous buffer requested for a non-contiguous" \
|
||||
"object.");
|
||||
"writable contiguous buffer requested "
|
||||
"for a non-contiguousobject.");
|
||||
return NULL;
|
||||
}
|
||||
bytes = PyBytes_FromStringAndSize(NULL, view->len);
|
||||
|
@ -485,7 +485,8 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key)
|
|||
return (PyObject *)self;
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_IndexError, "invalid indexing of 0-dim memory");
|
||||
PyErr_SetString(PyExc_IndexError,
|
||||
"invalid indexing of 0-dim memory");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -502,7 +503,9 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key)
|
|||
ptr += view->itemsize * result;
|
||||
else
|
||||
ptr += view->strides[0] * result;
|
||||
if (view->suboffsets != NULL && view->suboffsets[0] >= 0) {
|
||||
if (view->suboffsets != NULL &&
|
||||
view->suboffsets[0] >= 0)
|
||||
{
|
||||
ptr = *((char **)ptr) + view->suboffsets[0];
|
||||
}
|
||||
return PyBytes_FromStringAndSize(ptr, view->itemsize);
|
||||
|
|
Loading…
Reference in New Issue