For sanity, pass an actual list of keys into aux_get() instead
authorZac Medico <zmedico@gentoo.org>
Sun, 4 Nov 2007 00:25:10 +0000 (00:25 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 4 Nov 2007 00:25:10 +0000 (00:25 -0000)
of iterating over a set that happens to be mutable (though it
remains constant in practice). (trunk r8410)

svn path=/main/branches/2.1.2/; revision=8411

pym/portage.py

index efe65c5a3a13994ab7aa5840e7791666403ea069..d08350e7a442cd5d4e8ebeda29eb16787d3bbdf8 100644 (file)
@@ -6828,14 +6828,15 @@ class portdbapi(dbapi):
                        myval = ""
                        settings = self.mysettings
                        local_config = settings.local_config
+                       aux_keys = list(self._aux_cache_keys)
                        if level == "minimum-visible":
                                iterfunc = iter
                        else:
                                iterfunc = reversed
                        for cpv in iterfunc(mylist):
                                try:
-                                       metadata = dict(izip(self._aux_cache_keys,
-                                               self.aux_get(cpv, self._aux_cache_keys)))
+                                       metadata = dict(izip(aux_keys,
+                                               self.aux_get(cpv, aux_keys)))
                                except KeyError:
                                        # ebuild masked by corruption
                                        continue
@@ -6921,7 +6922,7 @@ class portdbapi(dbapi):
                if mylist is None:
                        return []
                newlist=[]
-               aux_keys = self._aux_cache_keys
+               aux_keys = list(self._aux_cache_keys)
                metadata = {}
                local_config = self.mysettings.local_config
                getMissingKeywords = self.mysettings._getMissingKeywords