mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #12834: Fix PyBuffer_ToContiguous() for non-contiguous arrays.
This commit is contained in:
parent
6c779ea553
commit
7d12d9df13
8 changed files with 410 additions and 68 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue