From 13d5905208b051518da35f85d051ae7ea18483d1 Mon Sep 17 00:00:00 2001 From: ATATC Date: Wed, 14 Feb 2024 16:09:58 -0500 Subject: [PATCH] Bug fixed: error parsing multiple parents. --- leads/dt/registry.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/leads/dt/registry.py b/leads/dt/registry.py index 5e24b600..276580ea 100644 --- a/leads/dt/registry.py +++ b/leads/dt/registry.py @@ -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: @@ -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 _