summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorPat Gunn <pgunn01@gmail.com>2018-06-01 15:22:14 -0400
committerPat Gunn <pgunn01@gmail.com>2018-06-01 15:22:14 -0400
commitd4e9503358ea48bb9b558503cb372346ab386167 (patch)
treea2a90f5dd6b0142cc195b34fdaf44fe34ba6bfdd /numpy
parent2cd293ddc5211e334e3d05856cde483edac459f3 (diff)
downloadnumpy-d4e9503358ea48bb9b558503cb372346ab386167.tar.gz
In numpy.memmap forcibly promote shape to uint64
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/memmap.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py
index 5be45affd..315825b9f 100644
--- a/numpy/core/memmap.py
+++ b/numpy/core/memmap.py
@@ -236,10 +236,11 @@ class memmap(ndarray):
raise ValueError("Size of available data is not a "
"multiple of the data-type size.")
size = bytes // _dbytes
- shape = (size,)
+ shape = (np.uint64(size),)
else:
if not isinstance(shape, tuple):
shape = (shape,)
+ shape = tuple(map(lambda x: np.uint64(x), shape)) # Force-promote to uint64, prevent possible overflow
size = 1
for k in shape:
size *= k