break recursion cycle
authorMarius Mauch <genone@gentoo.org>
Mon, 16 Jul 2007 12:53:13 +0000 (12:53 -0000)
committerMarius Mauch <genone@gentoo.org>
Mon, 16 Jul 2007 12:53:13 +0000 (12:53 -0000)
svn path=/main/trunk/; revision=7280

pym/portage/sets/__init__.py

index a7428c092a6c81ef9fadce4834937e75553b791c..cab64279b31bdebd3347c4adbfc1727a9be3db34 100644 (file)
@@ -27,7 +27,8 @@ class PackageSet(object):
                self._atoms = set()
                self._atommap = {}
                self._loaded = False
-       
+               self._loading = False
+
        def __contains__(self, atom):
                return atom in self.getAtoms()
        
@@ -41,9 +42,11 @@ class PackageSet(object):
                return op in self._operations
        
        def getAtoms(self):
-               if not self._loaded:
+               if not self._loaded and not self._loading:
+                       self._loading = True
                        self.load()
                        self._loaded = True
+                       self._loading = False
                return self._atoms
 
        def _setAtoms(self, atoms):