Skip to content

Commit

Permalink
Check strides is not None first
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Aug 11, 2020
1 parent dd614ab commit 113e679
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 @@ -71,7 +71,7 @@ cpdef Py_ssize_t get_buffer_nbytes(buffer, check_min_size, bint cuda_support) ex
nbytes *= <Py_ssize_t>shape[i]
# Check that data is contiguous
strides = iface.get("strides")
if ndim > 0 and strides is not None:
if strides is not None and ndim > 0:
if len(strides) != ndim:
raise ValueError(
"The length of shape and strides must be equal"
Expand Down

0 comments on commit 113e679

Please sign in to comment.