Fix a potential NameError due to 'cpv' being undefined in the namespace and also...
authorZac Medico <zmedico@gentoo.org>
Sun, 7 May 2006 20:36:02 +0000 (20:36 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 7 May 2006 20:36:02 +0000 (20:36 -0000)
svn path=/main/trunk/; revision=3329

pym/cache/metadata.py

index 1433ad489167490f96b42b59115a32b619761282..1fb19b39899221262233a12c77fc32d7690acbdc 100644 (file)
@@ -3,7 +3,7 @@
 # License: GPL2
 # $Id: metadata.py 1964 2005-09-03 00:16:16Z ferringb $
 
-import os, stat
+import os, stat, types
 import flat_hash
 import cache_errors
 import eclass_cache 
@@ -67,8 +67,10 @@ class database(flat_hash.database):
                        if "INHERITED" in d:
                                d["_eclasses_"] = self.ec.get_eclass_data(d["INHERITED"].split(), from_master_only=True)
                                del d["INHERITED"]
-               else:
-                       d["_eclasses_"] = reconstruct_eclasses(cpv, d["_eclasses_"])
+               elif not isinstance(d["_eclasses_"], types.DictType):
+                       # We skip this if flat_hash.database._parse_data() was called above
+                       # because it calls reconstruct_eclasses() internally.
+                       d["_eclasses_"] = reconstruct_eclasses(None, d["_eclasses_"])
 
                return d