From: Zac Medico Date: Thu, 10 Apr 2008 09:11:22 +0000 (-0000) Subject: Iterate over a copy of the digraph nodes so that removal can't break X-Git-Tag: v2.2_pre6~202 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4088b8572629223e29ec3e439dcc9888c9c72a54;p=portage.git Iterate over a copy of the digraph nodes so that removal can't break the iterator. svn path=/main/trunk/; revision=9799 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 6eae62d11..f99ba7bcd 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -7132,7 +7132,7 @@ def action_build(settings, trees, mtimedb, return retval if "--buildpkgonly" in myopts: graph_copy = mydepgraph.digraph.clone() - for node in graph_copy.order: + for node in list(graph_copy.order): if not isinstance(node, Package): graph_copy.remove(node) if not graph_copy.hasallzeros(ignore_priority=DepPriority.MEDIUM): @@ -7142,7 +7142,7 @@ def action_build(settings, trees, mtimedb, else: if "--buildpkgonly" in myopts: graph_copy = mydepgraph.digraph.clone() - for node in graph_copy.order: + for node in list(graph_copy.order): if not isinstance(node, Package): graph_copy.remove(node) if not graph_copy.hasallzeros(ignore_priority=DepPriority.MEDIUM):