Issue #12834: Fix PyBuffer_ToContiguous() for non-contiguous arrays.

This commit is contained in:
Stefan Krah 2012-07-28 12:25:55 +02:00
parent 6c779ea553
commit 7d12d9df13
8 changed files with 410 additions and 68 deletions

View file

@ -789,7 +789,7 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds)
size = view.len;
if (PyByteArray_Resize((PyObject *)self, size) < 0) goto fail;
if (PyBuffer_ToContiguous(self->ob_bytes, &view, size, 'C') < 0)
goto fail;
goto fail;
PyBuffer_Release(&view);
return 0;
fail: