Skip to content

Commit 33ffd3a

Browse files
committed
Ignore device_manager factories in utils
1 parent f3f1dc6 commit 33ffd3a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/dodal/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from importlib import import_module
1212
from inspect import signature
1313
from os import environ
14-
from types import ModuleType
14+
from types import FunctionType, ModuleType
1515
from typing import (
1616
Any,
1717
Generic,
@@ -413,7 +413,9 @@ def is_v2_device_factory(func: Callable) -> TypeGuard[V2DeviceFactory]:
413413

414414

415415
def is_any_device_factory(func: Callable) -> TypeGuard[AnyDeviceFactory]:
416-
return is_v1_device_factory(func) or is_v2_device_factory(func)
416+
return isinstance(func, (FunctionType, DeviceInitializationController)) and (
417+
is_v1_device_factory(func) or is_v2_device_factory(func)
418+
)
417419

418420

419421
def is_v2_device_type(obj: type[Any]) -> bool:

0 commit comments

Comments
 (0)