Skip to content

Commit 575087a

Browse files
authored
Asyncio future removed from sync client. (#2514)
1 parent 79a4ae6 commit 575087a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymodbus/transaction/transaction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(
6262
else:
6363
self._lock = asyncio.Lock()
6464
self.low_level_send = self.send
65-
self.response_future: asyncio.Future = asyncio.Future()
65+
self.response_future: asyncio.Future = asyncio.Future()
6666

6767
def dummy_trace_packet(self, sending: bool, data: bytes) -> bytes:
6868
"""Do dummy trace."""
@@ -161,8 +161,8 @@ async def server_execute(self) -> tuple[ModbusPDU, int, Exception]:
161161
Used in server, with an instance for each connection, therefore
162162
there are NO concurrency.
163163
"""
164-
pdu, addr, exc = await asyncio.wait_for(self.response_future, None)
165164
self.response_future = asyncio.Future()
165+
pdu, addr, exc = await asyncio.wait_for(self.response_future, None)
166166
return pdu, addr, exc
167167

168168
def pdu_send(self, pdu: ModbusPDU, addr: tuple | None = None) -> None:

0 commit comments

Comments
 (0)