Tweak code to avoid python-3.0 errors like this one:
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 05:53:05 +0000 (05:53 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 05:53:05 +0000 (05:53 -0000)
SyntaxError: can not delete variable 'e' referenced in nested scope
(trunk r12644)

svn path=/main/branches/2.1.6/; revision=12916

pym/_emerge/__init__.py

index 69f29ae7ba89c8bd96ab3d7ef8aa319a4e663c9c..977fae2571a4aece39176b0cc4d2c81189cd4864 100644 (file)
@@ -11147,7 +11147,11 @@ class Scheduler(PollScheduler):
                        success, mydepgraph, dropped_tasks = resume_depgraph(
                                self.settings, self.trees, self._mtimedb, self.myopts,
                                myparams, self._spinner)
-               except depgraph.UnsatisfiedResumeDep, e:
+               except depgraph.UnsatisfiedResumeDep, exc:
+                       # rename variable to avoid python-3.0 error:
+                       # SyntaxError: can not delete variable 'e' referenced in nested
+                       #              scope
+                       e = exc
                        mydepgraph = e.depgraph
                        dropped_tasks = set()
 
@@ -13653,9 +13657,11 @@ def resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
                                                unsatisfied_parents[parent_node] = parent_node
                                                unsatisfied_stack.append(parent_node)
 
-                       pruned_mergelist = [x for x in mergelist \
+                       pruned_mergelist = []
+                       for x in mergelist:
                                if isinstance(x, list) and \
-                               tuple(x) not in unsatisfied_parents]
+                                       tuple(x) not in unsatisfied_parents:
+                                       pruned_mergelist.append(x)
 
                        # If the mergelist doesn't shrink then this loop is infinite.
                        if len(pruned_mergelist) == len(mergelist):