summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielhrisca <daniel.hrisca@gmail.com>2018-12-23 08:34:05 +0200
committerdanielhrisca <daniel.hrisca@gmail.com>2018-12-23 08:34:05 +0200
commit41de695d6482f35c9fe4a05f1dde8b817adcee1a (patch)
tree15605ac509da66d84eff72e04e0831746a6b207a
parent6b8441665fb877ab65ec067de7be776ff4f5ac54 (diff)
downloadnumpy-41de695d6482f35c9fe4a05f1dde8b817adcee1a.tar.gz
BUG: check if dtype or formats arguments are not None when calling numpy.core.records.fromfile
-rw-r--r--numpy/core/records.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/core/records.py b/numpy/core/records.py
index 4d18c5712..507258c15 100644
--- a/numpy/core/records.py
+++ b/numpy/core/records.py
@@ -767,6 +767,9 @@ def fromfile(fd, dtype=None, shape=None, offset=0, formats=None,
>>> r.shape
(10,)
"""
+
+ if dtype is None and formats is None:
+ raise ValueError("Must have dtype= or formats=")
if (shape is None or shape == 0):
shape = (-1,)