summaryrefslogtreecommitdiff
path: root/numpy/lib/recfunctions.py
diff options
context:
space:
mode:
authorweathergod <?@?>2010-11-21 18:37:51 -0700
committerCharles Harris <charlesr.harris@gmail.com>2010-11-24 20:14:00 -0700
commit3b8cf12ee19994389ae3261666dd32cced4787be (patch)
tree074f147269ff8aaab53f921a38684ce0202ba9e4 /numpy/lib/recfunctions.py
parent8fa2591fee88937b81c39a6c529fa66975f88856 (diff)
downloadnumpy-3b8cf12ee19994389ae3261666dd32cced4787be.tar.gz
BUG: Fix logic in handling of dtype in append_fields.
Diffstat (limited to 'numpy/lib/recfunctions.py')
-rw-r--r--numpy/lib/recfunctions.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py
index 3c0094aae..da0c3e8ac 100644
--- a/numpy/lib/recfunctions.py
+++ b/numpy/lib/recfunctions.py
@@ -614,8 +614,10 @@ def append_fields(base, names, data=None, dtypes=None,
if dtypes is None:
data = [np.array(a, copy=False, subok=True) for a in data]
data = [a.view([(name, a.dtype)]) for (name, a) in zip(names, data)]
- elif not hasattr(dtypes, '__iter__'):
- dtypes = [dtypes, ]
+ else :
+ if not hasattr(dtypes, '__iter__'):
+ dtypes = [dtypes, ]
+
if len(data) != len(dtypes):
if len(dtypes) == 1:
dtypes = dtypes * len(data)