diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-02-19 11:36:57 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-02-19 11:36:57 +0000 |
commit | b032a537a6ed957c7d8797a8673b246d5fb4b603 (patch) | |
tree | 90fc394c1b0fd0c2c8935ab0e46393518dc7bda1 | |
parent | 1e0b0027a988de236a5541e5c72036c7b5bb75e6 (diff) | |
download | portage-b032a537a6ed957c7d8797a8673b246d5fb4b603.tar.gz portage-b032a537a6ed957c7d8797a8673b246d5fb4b603.tar.bz2 portage-b032a537a6ed957c7d8797a8673b246d5fb4b603.zip |
Tweak code to avoid python-3.0 errors like this one:
SyntaxError: can not delete variable 'e' referenced in nested scope
svn path=/main/trunk/; revision=12644
-rw-r--r-- | pym/_emerge/__init__.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index aab09d86b..073bc03ac 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -11163,7 +11163,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() @@ -14007,9 +14011,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): |