commit:     c0e1d514c1c8159aa732d23a527640432a9c076d
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 14 20:40:23 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Jul 14 21:28:32 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c0e1d514

portage/sync.__init__.py: Trap KeyError in module_specific_options()

Return an empty frozenset if the sync module is older and does not contain a
module_specific_option definition in it's module_spec.
Makes the module_specific_options addition backwards compatible with existing 
sync modules.

 pym/portage/sync/__init__.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pym/portage/sync/__init__.py b/pym/portage/sync/__init__.py
index b0e0ebe..32b2c45 100644
--- a/pym/portage/sync/__init__.py
+++ b/pym/portage/sync/__init__.py
@@ -31,9 +31,11 @@ def module_specific_options(repo):
        global module_controller
 
        if repo.sync_type:
-               opts = frozenset([opt for opt in
-                       
module_controller.modules[repo.sync_type]['module_specific_options']])
-               return opts
+               try:
+                       return frozenset(
+                               
module_controller.modules[repo.sync_type]['module_specific_options'])
+               except KeyError:
+                       pass
        return frozenset()
 
 

Reply via email to