Use dict.get() to prevent a potential (bug unlikely) KeyError.
authorZac Medico <zmedico@gentoo.org>
Thu, 11 Jan 2007 18:09:08 +0000 (18:09 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 11 Jan 2007 18:09:08 +0000 (18:09 -0000)
svn path=/main/trunk/; revision=5554

pym/portage.py

index b0505fba97ee391afe3d0cb5f04ac03787e42117..4bf3a9353e83a8bc805b8979c2db5866fff8a432 100644 (file)
@@ -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