Skip to content

Commit

Permalink
Bug fixed: error parsing multiple parents.
Browse files Browse the repository at this point in the history
  • Loading branch information
ATATC committed Feb 14, 2024
1 parent 4215a9d commit 13d5905
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions leads/dt/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ def device(tag: str | _Sequence[str],
kwargs: dict[str, _Any] | list[dict[str, _Any]] | None = None) -> _Callable[[type], None]:
if isinstance(tag, str):
tag = [tag]
p = _controllers[parent]
n = len(tag)
if isinstance(parent, str):
p = [parent] * n
parent = [parent] * n
if isinstance(args, tuple):
args = [args] * n
if not kwargs:
Expand All @@ -53,7 +52,7 @@ def _(target: type) -> None:
if not issubclass(target, Device):
raise TypeError("Devices must inherit from `Device`")
for i in range(len(tag)):
_register_device(target, tag[i], p, args[i], kwargs[i])
_register_device(target, tag[i], _controllers[parent[i]], args[i], kwargs[i])

return _

Expand Down

0 comments on commit 13d5905

Please sign in to comment.