Skip to content

Commit 782af64

Browse files
committed
Use math.prod so as to avoid an int32 overflow on win
1 parent 7cf17a6 commit 782af64

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/ndarray/test_zeros.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# LICENSE file in the root directory of this source tree)
77
#######################################################################
88

9+
import math
10+
911
import numpy as np
1012
import pytest
1113

@@ -61,7 +63,7 @@ def test_zeros(shape, chunks, blocks, dtype, cparams, urlpath, contiguous, meta)
6163
blosc2.remove_urlpath(urlpath)
6264

6365
dtype = np.dtype(dtype)
64-
if np.prod(chunks) * dtype.itemsize > blosc2.MAX_BUFFERSIZE:
66+
if math.prod(chunks) * dtype.itemsize > blosc2.MAX_BUFFERSIZE:
6567
with pytest.raises(RuntimeError):
6668
_ = blosc2.zeros(
6769
shape,

0 commit comments

Comments
 (0)