From 840138790073c5b53e583d3c92cf0be0d7f31724 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 30 Jun 2022 19:10:46 -0500 Subject: [PATCH] Drop a few more loop arguments Fixes #67 --- rflink/protocol.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rflink/protocol.py b/rflink/protocol.py index eeb463e..7535051 100644 --- a/rflink/protocol.py +++ b/rflink/protocol.py @@ -232,8 +232,8 @@ def __init__( super().__init__(*args, **kwargs) if packet_callback: self.packet_callback = packet_callback - self._command_ack = asyncio.Event(loop=self.loop) - self._ready_to_send = asyncio.Lock(loop=self.loop) + self._command_ack = asyncio.Event() + self._ready_to_send = asyncio.Lock() def handle_response_packet(self, packet: PacketType) -> None: """Handle response packet.""" @@ -254,9 +254,7 @@ def send_command_ack( log.debug("waiting for acknowledgement") try: - yield from asyncio.wait_for( - self._command_ack.wait(), TIMEOUT.seconds, loop=self.loop - ) + yield from asyncio.wait_for(self._command_ack.wait(), TIMEOUT.seconds) log.debug("packet acknowledged") except concurrent.futures._base.TimeoutError: acknowledgement = False