[cig-commits] r18454 - cs/pythia/trunk/pyre/inventory/cfg

brad at geodynamics.org brad at geodynamics.org
Tue May 24 15:15:02 PDT 2011


Author: brad
Date: 2011-05-24 15:15:01 -0700 (Tue, 24 May 2011)
New Revision: 18454

Modified:
   cs/pythia/trunk/pyre/inventory/cfg/Parser.py
Log:
Fixed Parser bug. Python 2.7.1? returns array containing value while Python <= 2.7.0 returns value. Workaround is to check for list of size 1 and convert to a value.

Modified: cs/pythia/trunk/pyre/inventory/cfg/Parser.py
===================================================================
--- cs/pythia/trunk/pyre/inventory/cfg/Parser.py	2011-05-24 21:50:21 UTC (rev 18453)
+++ cs/pythia/trunk/pyre/inventory/cfg/Parser.py	2011-05-24 22:15:01 UTC (rev 18454)
@@ -58,6 +58,9 @@
             key = path[-1]
             path = path[:-1]
             node = _getNode(self.node, path)
+            if type(value) is list:
+                assert(1 == len(value))
+                value = value[0]
             value = expandMacros(value, self.macros)
             node.setProperty(key, value, locator)
             dict.__setitem__(self, key, value)



More information about the CIG-COMMITS mailing list