Skip to content

Commit 90449d8

Browse files
committed
Fix exception when removing self-referencing cycles
1 parent bfbc024 commit 90449d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ogc/bblocks/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ def __init__(self,
510510
while cycles:
511511
#for cycle in cycles:
512512
# dep_graph.remove_edge(cycle[0], cycle[1])
513-
dep_graph.remove_edges_from((cycle[0], cycle[1]) for cycle in cycles)
513+
dep_graph.remove_edges_from((cycle[0], cycle[-1]) for cycle in cycles)
514514
cycles = list(nx.simple_cycles(dep_graph))
515515
self.bblocks: dict[str, BuildingBlock] = {b: self.bblocks[b]
516516
for b in nx.topological_sort(dep_graph)

0 commit comments

Comments
 (0)