Iterate over a list in order to avoid breaking the iterator when an atom is removed.
authorZac Medico <zmedico@gentoo.org>
Tue, 17 Jul 2007 21:41:53 +0000 (21:41 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 17 Jul 2007 21:41:53 +0000 (21:41 -0000)
svn path=/main/trunk/; revision=7303

pym/portage/sets/__init__.py

index 163e84eaf2e1727f8ea15ee1b53efb4d917f9163..29dc60c07670fe91ea37aaf972ec288fcf52a3ea 100644 (file)
@@ -135,7 +135,7 @@ class EditablePackageSet(PackageSet):
                self.write()
 
        def removePackageAtoms(self, cp):
-               for a in self.getAtoms():
+               for a in list(self.getAtoms()):
                        if dep_getkey(a) == cp:
                                self.remove(a)
                self.write()