Handle a KeyError when validating the blocker cache.
authorZac Medico <zmedico@gentoo.org>
Wed, 30 Apr 2008 09:00:24 +0000 (09:00 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 30 Apr 2008 09:00:24 +0000 (09:00 -0000)
svn path=/main/trunk/; revision=10045

pym/_emerge/__init__.py

index ad9a05c86cdee0393f130a5139d76a63f43d9003..06c034dd7329c080cdb27d9110f737c2122bf349 100644 (file)
@@ -1407,7 +1407,12 @@ class BlockerCache(DictMixin):
                                        invalid_cache.add(cpv)
                                        continue
                                counter, atoms = value
-                               if counter != long(self._vardb.aux_get(cpv, ["COUNTER"])[0]):
+                               try:
+                                       if counter != long(self._vardb.aux_get(cpv, ["COUNTER"])[0]):
+                                               invalid_cache.add(cpv)
+                                               continue
+                               except KeyError:
+                                       # The package is no longer installed.
                                        invalid_cache.add(cpv)
                                        continue
                        for cpv in invalid_cache: