Skip to content

Commit 902e9ab

Browse files
use find_cycles in contains_cycle
1 parent 27255a5 commit 902e9ab

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

pytools/graph.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,7 @@ def contains_cycle(graph: GraphT) -> bool:
417417
.. versionadded:: 2020.2
418418
"""
419419

420-
try:
421-
compute_topological_order(graph, verbose_cycle=False)
422-
return False
423-
except CycleError:
424-
return True
420+
return bool(find_cycles)
425421

426422
# }}}
427423

0 commit comments

Comments
 (0)