Skip to content

Commit

Permalink
MAI: update to networkx >= 2.0
Browse files Browse the repository at this point in the history
Graphs do not have an attribute `node`.
Instead, use the attribute `nodes` [1].

[1] https://networkx.github.io/documentation/stable/release/migration_guide_from_1.x_to_2.0.html
  • Loading branch information
johnyf committed Sep 14, 2020
1 parent f9956ca commit 132aeaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions promela/ast.py
Expand Up @@ -148,9 +148,9 @@ def contract_goto_edges(g, u):
for p, _, d in g.in_edges(u, data=True):
g.add_edge(p, q, **d)
# but the source node label is preserved
u_label = g.node[u].get('labels')
u_label = g.nodes[u].get('labels')
if u_label is not None:
g.node[q].setdefault('labels', set()).update(u_label)
g.nodes[q].setdefault('labels', set()).update(u_label)
g.remove_node(u)
if u == g.root:
g.root = q
Expand Down

0 comments on commit 132aeaf

Please sign in to comment.