Skip to content

Commit

Permalink
Get readonly from the buffer protocol too
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Aug 11, 2020
1 parent 64ef5ec commit 1115256
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ucp/_libs/utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_buffer_data(buffer, check_writable=False):
else:
mview = memoryview(buffer)
data_ptr = <uintptr_t>PyMemoryView_GET_BUFFER(mview).buf
data_readonly = mview.readonly
data_readonly = <bint>PyMemoryView_GET_BUFFER(mview).readonly

if data_ptr == 0:
raise NotImplementedError("zero-sized buffers isn't supported")
Expand Down

0 comments on commit 1115256

Please sign in to comment.