return vec;
} else if (PyLong_AsLong(size) > 0) {
// short read, return a shorter array
- PyArrayObject *shortread = (PyArrayObject*)PyTuple_GetItem(done, 0);
+ PyArrayObject *shortread = (PyArrayObject*)
+ PyArray_FROM_OTF(PyTuple_GetItem(done, 0), NPY_NOTYPE,
+ NPY_ARRAY_ENSURECOPY);
PyArray_Dims newdims;
PyObject *reshaped;
newdims.len = PyArray_NDIM(shortread);