@@ -156,10 +156,10 @@ def __init__(
156156 self .is_server = is_server
157157 self .is_closing = False
158158
159- self .transport : asyncio .BaseTransport = None
160- self .loop : asyncio .AbstractEventLoop = None
159+ self .transport : asyncio .BaseTransport = None # type: ignore[assignment]
160+ self .loop : asyncio .AbstractEventLoop = None # type: ignore[assignment]
161161 self .recv_buffer : bytes = b""
162- self .call_create : Callable [[], Coroutine [Any , Any , Any ]] = lambda : None
162+ self .call_create : Callable [[], Coroutine [Any , Any , Any ]] = lambda : None # type: ignore[assignment, return-value]
163163 if self .is_server :
164164 self .active_connections : dict [str , ModbusProtocol ] = {}
165165 else :
@@ -413,7 +413,7 @@ def transport_close(self, intern: bool = False, reconnect: bool = False) -> None
413413 self .is_closing = True
414414 if self .transport :
415415 self .transport .close ()
416- self .transport = None
416+ self .transport = None # type: ignore[assignment]
417417 self .recv_buffer = b""
418418 if self .is_server :
419419 for _key , value in self .active_connections .items ():
@@ -515,7 +515,7 @@ def __init__(self, protocol: ModbusProtocol, listen: int | None = None) -> None:
515515 asyncio .DatagramTransport .__init__ (self )
516516 asyncio .Transport .__init__ (self )
517517 self .protocol : ModbusProtocol = protocol
518- self .other_modem : NullModem = None
518+ self .other_modem : NullModem = None # type: ignore[assignment]
519519 self .listen = listen
520520 self .manipulator : Callable [[bytes ], list [bytes ]] | None = None
521521 self ._is_closing = False
@@ -589,9 +589,9 @@ def close(self) -> None:
589589 with suppress (KeyError ):
590590 del self .connections [self ]
591591 if self .other_modem :
592- self .other_modem .other_modem = None
592+ self .other_modem .other_modem = None # type: ignore[assignment]
593593 self .other_modem .close ()
594- self .other_modem = None
594+ self .other_modem = None # type: ignore[assignment]
595595 if self .protocol :
596596 self .protocol .connection_lost (None )
597597
0 commit comments