summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-20 18:31:17 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-20 18:31:17 -0700
commit33b197b02574c0f49d4dce659562d2f3362e5eba (patch)
tree2821e463f12814e9a09859d749444f0a671c3df4
parent1fdeb78d08bac14f3f999f112499d179a87cf342 (diff)
downloadportage-33b197b02574c0f49d4dce659562d2f3362e5eba.tar.gz
portage-33b197b02574c0f49d4dce659562d2f3362e5eba.tar.bz2
portage-33b197b02574c0f49d4dce659562d2f3362e5eba.zip
UseManager: avoid possible repo KeyErrors
-rw-r--r--pym/portage/package/ebuild/_config/UseManager.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pym/portage/package/ebuild/_config/UseManager.py b/pym/portage/package/ebuild/_config/UseManager.py
index de18500a9..67e92944e 100644
--- a/pym/portage/package/ebuild/_config/UseManager.py
+++ b/pym/portage/package/ebuild/_config/UseManager.py
@@ -148,8 +148,8 @@ class UseManager(object):
usemask = []
if hasattr(pkg, "repo") and pkg.repo != Package.UNKNOWN_REPO:
for repo in [repo.name for repo in self.repositories[pkg.repo].masters] + [pkg.repo]:
- usemask.append(self._repo_usemask_dict[repo])
- cpdict = self._repo_pusemask_dict[repo].get(cp)
+ usemask.append(self._repo_usemask_dict.get(repo, {}))
+ cpdict = self._repo_pusemask_dict.get(repo, {}).get(cp)
if cpdict:
pkg_usemask = ordered_by_atom_specificity(cpdict, pkg)
if pkg_usemask:
@@ -175,8 +175,8 @@ class UseManager(object):
useforce = []
if hasattr(pkg, "repo") and pkg.repo != Package.UNKNOWN_REPO:
for repo in [repo.name for repo in self.repositories[pkg.repo].masters] + [pkg.repo]:
- useforce.append(self._repo_useforce_dict[repo])
- cpdict = self._repo_puseforce_dict[repo].get(cp)
+ useforce.append(self._repo_useforce_dict.get(repo, {}))
+ cpdict = self._repo_puseforce_dict.get(repo, {}).get(cp)
if cpdict:
pkg_useforce = ordered_by_atom_specificity(cpdict, pkg)
if pkg_useforce: