From: Zac Medico Date: Thu, 11 Jan 2007 18:09:08 +0000 (-0000) Subject: Use dict.get() to prevent a potential (bug unlikely) KeyError. X-Git-Tag: v2.1.2~77 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=912ffed14090eb8659c9850dc52a88038e960293;p=portage.git Use dict.get() to prevent a potential (bug unlikely) KeyError. svn path=/main/trunk/; revision=5554 --- diff --git a/pym/portage.py b/pym/portage.py index b0505fba9..4bf3a9353 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1884,13 +1884,13 @@ class config: myflags = set(myflags) myflags.update(self.useforce) + # FEATURES=test should imply USE=test + if "test" in self.configlist[-1].get("FEATURES","").split(): + myflags.add("test") + usesplit = [ x for x in myflags if \ x not in self.usemask] - # FEATURES=test should imply USE=test - if "test" in self.configlist[-1]["FEATURES"] and not "test" in usesplit: - usesplit.append("test") - usesplit.sort() # Use the calculated USE flags to regenerate the USE_EXPAND flags so