File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 11"""Simulator data model classes."""
22from __future__ import annotations
33
4- import asyncio
4+ import inspect
55from collections .abc import Awaitable , Callable
66from dataclasses import dataclass
77from typing import TypeAlias , cast
@@ -140,7 +140,7 @@ def __check_simple(self):
140140 raise TypeError ("1 <= address + count < 65536" )
141141 if not isinstance (self .datatype , DataType ):
142142 raise TypeError ("datatype= must by an DataType" )
143- if self .action and not (callable (self .action ) and asyncio .iscoroutinefunction (self .action )):
143+ if self .action and not (callable (self .action ) and inspect .iscoroutinefunction (self .action )):
144144 raise TypeError ("action= not a async function" )
145145 if self .register_count != - 1 :
146146 raise TypeError ("register_count= is illegal" )
@@ -166,6 +166,3 @@ def __post_init__(self):
166166 raise TypeError (f"value= can only contain { x_datatype !s} " )
167167 super ().__setattr__ ("register_count" , self .count * x_len )
168168 super ().__setattr__ ("type_size" , x_len )
169-
170-
171-
You can’t perform that action at this time.
0 commit comments