summaryrefslogtreecommitdiff
path: root/numpy/core/records.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-10-30 22:05:11 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-10-30 22:05:11 +0000
commit6d3f78e6665122ec7b9dffaa1c81c0327bccd365 (patch)
tree7e7218d4d38c86fe7ea0c9df322b47de5b04734a /numpy/core/records.py
parent4d11fdfa180f9e1412b18278c95b17d2040ea67f (diff)
downloadnumpy-6d3f78e6665122ec7b9dffaa1c81c0327bccd365.tar.gz
Fixes when fielddict is None
Diffstat (limited to 'numpy/core/records.py')
-rw-r--r--numpy/core/records.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/records.py b/numpy/core/records.py
index a6d2b48b0..8bcc0c481 100644
--- a/numpy/core/records.py
+++ b/numpy/core/records.py
@@ -213,12 +213,12 @@ class recarray(ndarray):
try:
ret = object.__setattr__(self, attr, val)
except:
- fielddict = ndarray.__getattribute__(self,'dtype').fields
+ fielddict = ndarray.__getattribute__(self,'dtype').fields or {}
if attr not in fielddict:
exctype, value = sys.exc_info()[:2]
raise exctype, value
else:
- fielddict = ndarray.__getattribute__(self,'dtype').fields
+ fielddict = ndarray.__getattribute__(self,'dtype').fields or {}
if attr not in fielddict:
return ret
if newattr: # We just added this one