Commit a04eb82c authored by Christoph Groth's avatar Christoph Groth
Browse files

(hopefully temporary) workaround for Cython, makes arrays writable using the buffer interface

parent 1b14b07d
......@@ -462,10 +462,13 @@ int getbuffer(Array<T> *self, Py_buffer *view, int flags)
"Tinyarrays are not Fortran contiguous.");
goto fail;
}
if ((flags & PyBUF_WRITEABLE) == PyBUF_WRITEABLE) {
PyErr_SetString(PyExc_BufferError, "Tinyarrays are not writeable");
goto fail;
}
// The following has been commented out as a workaround for Cython's
// inability to deal with read-only buffers.
//
// if ((flags & PyBUF_WRITEABLE) == PyBUF_WRITEABLE) {
// PyErr_SetString(PyExc_BufferError, "Tinyarrays are not writeable");
// goto fail;
// }
self->ndim_shape(&ndim, &shape);
size = calc_size(ndim, shape);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment