Skip to content

Commit a8f5653

Browse files
committed
comment/type hint
1 parent 843656f commit a8f5653

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

appdaemon/dependency.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ast
22
import logging
3-
from collections.abc import Generator
3+
from collections.abc import Generator, Mapping
44
from graphlib import TopologicalSorter
55
from pathlib import Path
66
from typing import Iterable
@@ -207,18 +207,14 @@ def find_all_dependents(
207207
return visited
208208

209209

210-
class CircularDependency(Exception):
211-
pass
212-
213-
214-
def topo_sort(graph: dict[str, set[str]]) -> list[str]:
210+
def topo_sort(graph: Mapping[str, set[str]]) -> list[str]:
215211
"""Topological sort
216212
217213
Args:
218214
graph (Mapping[str, set[str]]): Dependency graph
219215
220216
Raises:
221-
CircularDependency: Raised if a cycle is detected
217+
CycleError: Raised if a cycle is detected
222218
223219
Returns:
224220
list[str]: Ordered list of the nodes

0 commit comments

Comments
 (0)