summaryrefslogtreecommitdiff
path: root/numpy/lib/npyio.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2019-08-19 16:54:35 -0500
committerEric Wieser <wieser.eric@gmail.com>2019-08-19 19:15:17 -0500
commit8187c9efcfcaa5d9ae0fcda42f9512b860001ffa (patch)
tree37aea3f136a3b3fe1519aac8e6591c985f91db3c /numpy/lib/npyio.py
parentb11468e1a38c19a24ed0ebaede023c159c745e33 (diff)
downloadnumpy-8187c9efcfcaa5d9ae0fcda42f9512b860001ffa.tar.gz
BUG: Don't construct masked arrays with the wrong mask type in genfromtxt
This only affects arrays with `dtype([])`, but also follows the recommended way to check for structured arrays in our docs
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r--numpy/lib/npyio.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index 1991f289a..a4a377e4a 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -2197,7 +2197,7 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
#
output = np.array(data, dtype)
if usemask:
- if dtype.names:
+ if dtype.names is not None:
mdtype = [(_, bool) for _ in dtype.names]
else:
mdtype = bool