summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-28 20:30:46 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-28 20:30:46 +0000
commit8b4009ca329545a14173c5491dfe26a247066df2 (patch)
tree7679ff98a664bdcf8883a40ec99dc5dd9b5735f9
parentd35a92856a8bb545cce872a9ca5c204388b4ee7a (diff)
downloadportage-8b4009ca329545a14173c5491dfe26a247066df2.tar.gz
portage-8b4009ca329545a14173c5491dfe26a247066df2.tar.bz2
portage-8b4009ca329545a14173c5491dfe26a247066df2.zip
Fix SetConfig.getSetAtoms() to stop initializing ignorelist
in the parameter list since otherwise the ignorelist persists between calls and causes unpredictable results for callers. svn path=/main/trunk/; revision=8333
-rw-r--r--pym/portage/sets/__init__.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py
index 9f562820b..940aa1020 100644
--- a/pym/portage/sets/__init__.py
+++ b/pym/portage/sets/__init__.py
@@ -94,14 +94,17 @@ class SetConfig(SafeConfigParser):
self.aliases = shortnames
return self.aliases
- def getSetAtoms(self, setname, ignorelist=[]):
+ def getSetAtoms(self, setname, ignorelist=None):
myset = self.getSetsWithAliases()[setname]
myatoms = myset.getAtoms()
- ignorelist.append(setname)
+ if ignorelist is None:
+ ignorelist = set()
+ ignorelist.add(setname)
for n in myset.getNonAtoms():
if n[0] == SETPREFIX and n[1:] in self.aliases:
if n[1:] not in ignorelist:
- myatoms.update(self.getSetAtoms(n[1:]))
+ myatoms.update(self.getSetAtoms(n[1:],
+ ignorelist=ignorelist))
return myatoms
def make_default_config(settings, trees):