[Numpy-svn] r3418 - trunk/numpy/core

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Oct 30 16:05:14 CST 2006


Author: oliphant
Date: 2006-10-30 16:05:11 -0600 (Mon, 30 Oct 2006)
New Revision: 3418

Modified:
   trunk/numpy/core/records.py
Log:
Fixes when fielddict is None

Modified: trunk/numpy/core/records.py
===================================================================
--- trunk/numpy/core/records.py	2006-10-30 19:21:25 UTC (rev 3417)
+++ trunk/numpy/core/records.py	2006-10-30 22:05:11 UTC (rev 3418)
@@ -213,12 +213,12 @@
         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



More information about the Numpy-svn mailing list