diff options
Diffstat (limited to 'numpy/core/records.py')
-rw-r--r-- | numpy/core/records.py | 4 |
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 |