Unpack the _eclasses_ value as it's packed by the database template's __setitem__...
authorJason Stubbs <jstubbs@gentoo.org>
Sat, 17 Dec 2005 17:13:13 +0000 (17:13 -0000)
committerJason Stubbs <jstubbs@gentoo.org>
Sat, 17 Dec 2005 17:13:13 +0000 (17:13 -0000)
svn path=/main/trunk/; revision=2393

pym/cache/anydbm.py

index bc380ae2766119cf65db76044d7964e6b12dc1b8..28d1a889e7d68407394e147bec5af2c618cc279f 100644 (file)
@@ -10,6 +10,7 @@ except ImportError:
        import pickle
 import os
 import fs_template
+from template import reconstruct_eclasses
 import cache_errors
 
 
@@ -51,7 +52,10 @@ class database(fs_template.FsBased):
 
        def __getitem__(self, cpv):
                # we override getitem because it's just a cpickling of the data handed in.
-               return pickle.loads(self.__db[cpv])
+               d = pickle.loads(self.__db[cpv])
+                if "_eclasses_" in d:
+                        d["_eclasses_"] = reconstruct_eclasses(cpv, d["_eclasses_"])
+               return d
 
 
        def _setitem(self, cpv, values):