-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dir
Description
The prepare()
method of graphlib.TopologicalSorter
class raises a CycleError
if any cycles are detected in the graph.
Lines 104 to 106 in e2c4038
cycle = self._find_cycle() | |
if cycle: | |
raise CycleError(f"nodes are in a cycle", cycle) |
The docstring for CycleError
promises the cycle (list of nodes) to be accessible in the Exception's args attribute.
The detected cycle can be accessed via the second
element in the args attribute of the exception instance
The f-string for the first argument to the CycleError is therefore redundant and may cause confusion.
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dir