Commit 647c8bb5 authored by Jameson Rollins's avatar Jameson Rollins
Browse files

graph: don't modify graph during edge iteration

fixes error in python3
parent 5f62c8ce
......@@ -163,6 +163,7 @@ def sys2dot(system,
G.node[node]['fontcolor'] = fontcolor
# set edge attributes
remove_edges = []
for edge in G.edges_iter(data=True, keys=True):
source, sink, key, data = edge
......@@ -186,7 +187,7 @@ def sys2dot(system,
data['fontcolor'] = 'grey'
else:
if edge[:2] not in path_edges:
G.remove_edge(source, sink, key)
remove_edges.append((source, sink, key))
# jump edges
if data.get('jump', False):
......@@ -200,6 +201,9 @@ def sys2dot(system,
data['color'] = '/set19/5'
data['penwidth'] = 5
for edge in remove_edges:
G.remove_edge(*edge)
# do the graphviz conversion
dot = to_pydot(G)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment