diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-06-26 18:24:34 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-06-26 18:24:34 +0000 |
commit | 92b579d48d4028e995a3109837c9328fb07e06ce (patch) | |
tree | f2500623bf62c4d61a6b9759724c74691ee3304b | |
parent | 1850407d79782de1cd920499086086cb0fb720ca (diff) | |
download | portage-92b579d48d4028e995a3109837c9328fb07e06ce.tar.gz portage-92b579d48d4028e995a3109837c9328fb07e06ce.tar.bz2 portage-92b579d48d4028e995a3109837c9328fb07e06ce.zip |
Handle KeyError from aux_get() inside dbapi._iter_match_slot() and
_iter_match_use(). Thanks to grobian for reporting.
svn path=/main/trunk/; revision=10802
-rw-r--r-- | pym/portage/dbapi/__init__.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index ba37c867e..54ce7afc3 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -135,8 +135,11 @@ class dbapi(object): def _iter_match_slot(self, atom, cpv_iter): for cpv in cpv_iter: - if self.aux_get(cpv, ["SLOT"])[0] == atom.slot: - yield cpv + try: + if self.aux_get(cpv, ["SLOT"])[0] == atom.slot: + yield cpv + except KeyError: + continue def _iter_match_use(self, atom, cpv_iter): """ @@ -146,7 +149,10 @@ class dbapi(object): if self._iuse_implicit is None: self._iuse_implicit = self.settings._get_implicit_iuse() for cpv in cpv_iter: - iuse, use = self.aux_get(cpv, ["IUSE", "USE"]) + try: + iuse, use = self.aux_get(cpv, ["IUSE", "USE"]) + except KeyError: + continue use = use.split() iuse = self._iuse_implicit.union( re.escape(x.lstrip("+-")) for x in iuse.split()) |