Skip to content

Commit 078eb48

Browse files
committed
Check type is a type
1 parent 095f364 commit 078eb48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/blueapi/core/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def is_bluesky_type(typ: type) -> bool:
107107
return (
108108
typ in BLUESKY_PROTOCOLS
109109
or isinstance(typ, BLUESKY_PROTOCOLS)
110-
or issubclass(typ, AsyncDevice)
110+
or (isinstance(typ, type) and issubclass(typ, AsyncDevice))
111111
)
112112

113113

@@ -536,7 +536,7 @@ def _convert_type(self, typ: type | Any, no_default: bool = True) -> type:
536536
if typ is NoneType and not no_default:
537537
return SkipJsonSchema[NoneType]
538538
root = get_origin(typ)
539-
if is_bluesky_type(typ) or (root is not None and is_bluesky_type(root)):
539+
if is_bluesky_type(root or typ):
540540
return self._reference(typ)
541541
args = get_args(typ)
542542
if args:

0 commit comments

Comments
 (0)