From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 90F58138D1D for ; Tue, 14 Jul 2015 21:31:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5F9CBE0867; Tue, 14 Jul 2015 21:31:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BE164E0867 for ; Tue, 14 Jul 2015 21:31:28 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E341D340A12 for ; Tue, 14 Jul 2015 21:31:27 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0C8A998B for ; Tue, 14 Jul 2015 21:31:26 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1436909312.c0e1d514c1c8159aa732d23a527640432a9c076d.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/sync/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/sync/__init__.py X-VCS-Directories: pym/portage/sync/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: c0e1d514c1c8159aa732d23a527640432a9c076d X-VCS-Branch: master Date: Tue, 14 Jul 2015 21:31:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 16e44c26-7e7b-4298-9d55-08fe46d3dd14 X-Archives-Hash: dcaa5c21ce8a3496dcb3cec4c1f68399 commit: c0e1d514c1c8159aa732d23a527640432a9c076d Author: Brian Dolbec gentoo org> AuthorDate: Tue Jul 14 20:40:23 2015 +0000 Commit: Brian Dolbec gentoo 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()