From cac1ff78d09a967e78532b1f842f1d3762046d01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Piron?= <4469877+michaelpiron@users.noreply.github.com> Date: Wed, 4 Jan 2023 00:08:45 +0100 Subject: [PATCH] asyncio.wait_for - remove loop parameter Since Python v3.10, the loop argument is removed from asyncio.wait_for coroutine. --- eltakobus/serial.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eltakobus/serial.py b/eltakobus/serial.py index 03963b4..7c995ad 100644 --- a/eltakobus/serial.py +++ b/eltakobus/serial.py @@ -69,7 +69,7 @@ async def run_echotest(self): self.transport.write(echotest) try: - await asyncio.wait_for(self.await_bufferlevel(len(echotest)), timeout=0.2, loop=self._loop) + await asyncio.wait_for(self.await_bufferlevel(len(echotest)), timeout=0.2) except asyncio.TimeoutError: continue @@ -210,7 +210,7 @@ def hook(message): await self.send(request) try: # FIXME this timeout is rather arbitrary - return await asyncio.wait_for(match, timeout=1, loop=self._loop) + return await asyncio.wait_for(match, timeout=1) except asyncio.TimeoutError: if responsetype is EltakoTimeout: return EltakoTimeout()