Skip to content

Commit 2b5877b

Browse files
committed
Fix incorrect cycle removal
1 parent 10fe1f5 commit 2b5877b

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
@@ -521,7 +521,7 @@ def __init__(self,
521521
while cycles:
522522
#for cycle in cycles:
523523
# dep_graph.remove_edge(cycle[0], cycle[1])
524-
dep_graph.remove_edges_from((cycle[0], cycle[-1]) for cycle in cycles)
524+
dep_graph.remove_edges_from((cycle[0], cycle[min(1, len(cycle) - 1)]) for cycle in cycles)
525525
cycles = list(nx.simple_cycles(dep_graph))
526526
self.bblocks: dict[str, BuildingBlock] = {b: self.bblocks[b]
527527
for b in nx.topological_sort(dep_graph)

0 commit comments

Comments
 (0)