From 7ba94e9b6c06d73e25f337087340d23707170e75 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 23 Oct 2007 19:30:15 +0000 Subject: Optimize PROFILE_ONLY_VARIABLES handling. svn path=/main/trunk/; revision=8255 --- pym/portage/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pym') diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index ac391e645..cc713c1d2 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1195,9 +1195,10 @@ class config(object): # Don't allow the user to override certain variables in make.conf - for key in self.mygcfg.keys(): - if key in self.configdict["defaults"].get("PROFILE_ONLY_VARIABLES", "").split(): - del self.mygcfg[key] + profile_only_variables = self.configdict["defaults"].get( + "PROFILE_ONLY_VARIABLES", "").split() + for k in profile_only_variables: + self.mygcfg.pop(k, None) # Allow ROOT setting to come from make.conf if it's not overridden # by the constructor argument (from the calling environment). As a @@ -1224,9 +1225,8 @@ class config(object): myenv = os.environ.copy() # Don't allow the user to override certain variables in the env - for key in myenv.keys(): - if key in self.configdict["defaults"].get("PROFILE_ONLY_VARIABLES", "").split(): - del myenv[key] + for k in profile_only_variables: + myenv.pop(k, None) self.configlist.append(myenv) self.configdict["env"]=self.configlist[-1] -- cgit v1.2.3-1-g7c22