summaryrefslogtreecommitdiff
path: root/numpy/lib/format.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/format.py')
-rw-r--r--numpy/lib/format.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/numpy/lib/format.py b/numpy/lib/format.py
index 05fcbc0bc..86f71eda9 100644
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -267,15 +267,13 @@ def descr_to_dtype(descr):
This function reverses the process, eliminating the empty padding fields.
'''
- if isinstance(descr, (str, dict)):
+ if isinstance(descr, str):
# No padding removal needed
return numpy.dtype(descr)
elif isinstance(descr, tuple):
- if isinstance(descr[0], list):
- # subtype, will always have a shape descr[1]
- dt = descr_to_dtype(descr[0])
- return numpy.dtype((dt, descr[1]))
- return numpy.dtype(descr)
+ # subtype, will always have a shape descr[1]
+ dt = descr_to_dtype(descr[0])
+ return numpy.dtype((dt, descr[1]))
fields = []
offset = 0
for field in descr: