Skip to content

Commit 13d5905

Browse files
committed
Bug fixed: error parsing multiple parents.
1 parent 4215a9d commit 13d5905

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

leads/dt/registry.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ def device(tag: str | _Sequence[str],
3838
kwargs: dict[str, _Any] | list[dict[str, _Any]] | None = None) -> _Callable[[type], None]:
3939
if isinstance(tag, str):
4040
tag = [tag]
41-
p = _controllers[parent]
4241
n = len(tag)
4342
if isinstance(parent, str):
44-
p = [parent] * n
43+
parent = [parent] * n
4544
if isinstance(args, tuple):
4645
args = [args] * n
4746
if not kwargs:
@@ -53,7 +52,7 @@ def _(target: type) -> None:
5352
if not issubclass(target, Device):
5453
raise TypeError("Devices must inherit from `Device`")
5554
for i in range(len(tag)):
56-
_register_device(target, tag[i], p, args[i], kwargs[i])
55+
_register_device(target, tag[i], _controllers[parent[i]], args[i], kwargs[i])
5756

5857
return _
5958

0 commit comments

Comments
 (0)