Commit 692a7421 authored by Stefan Behnel's avatar Stefan Behnel Committed by GitHub

Merge pull request #2716 from jakirkham/memoryview_PyBUF_ND_shape

Fill shape when PyBUF_ND is in the flags
parents f158e490 0aee59ed
...@@ -64,6 +64,7 @@ cdef extern from *: ...@@ -64,6 +64,7 @@ cdef extern from *:
PyBUF_WRITABLE PyBUF_WRITABLE
PyBUF_STRIDES PyBUF_STRIDES
PyBUF_INDIRECT PyBUF_INDIRECT
PyBUF_ND
PyBUF_RECORDS PyBUF_RECORDS
PyBUF_RECORDS_RO PyBUF_RECORDS_RO
...@@ -514,7 +515,7 @@ cdef class memoryview(object): ...@@ -514,7 +515,7 @@ cdef class memoryview(object):
if flags & PyBUF_WRITABLE and self.view.readonly: if flags & PyBUF_WRITABLE and self.view.readonly:
raise ValueError("Cannot create writable memory view from read-only memoryview") raise ValueError("Cannot create writable memory view from read-only memoryview")
if flags & PyBUF_STRIDES: if flags & PyBUF_ND:
info.shape = self.view.shape info.shape = self.view.shape
else: else:
info.shape = NULL info.shape = NULL
......
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