From 51d2ffa33186829b4869739c56edf7c255c81c6a Mon Sep 17 00:00:00 2001 From: jan iversen Date: Fri, 20 Dec 2024 09:10:10 +0100 Subject: [PATCH] Asyncio future removed from sync client. --- pymodbus/transaction/transaction.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymodbus/transaction/transaction.py b/pymodbus/transaction/transaction.py index a98d2e21b..3a0cf1aa3 100644 --- a/pymodbus/transaction/transaction.py +++ b/pymodbus/transaction/transaction.py @@ -62,7 +62,7 @@ def __init__( else: self._lock = asyncio.Lock() self.low_level_send = self.send - self.response_future: asyncio.Future = asyncio.Future() + self.response_future: asyncio.Future = asyncio.Future() def dummy_trace_packet(self, sending: bool, data: bytes) -> bytes: """Do dummy trace.""" @@ -161,8 +161,8 @@ async def server_execute(self) -> tuple[ModbusPDU, int, Exception]: Used in server, with an instance for each connection, therefore there are NO concurrency. """ - pdu, addr, exc = await asyncio.wait_for(self.response_future, None) self.response_future = asyncio.Future() + pdu, addr, exc = await asyncio.wait_for(self.response_future, None) return pdu, addr, exc def pdu_send(self, pdu: ModbusPDU, addr: tuple | None = None) -> None: