Skip to content

Commit

Permalink
Drop a few more loop arguments
Browse files Browse the repository at this point in the history
Fixes #67
  • Loading branch information
bdraco authored and Johan Bloemberg committed Jul 4, 2022
1 parent ddf4b91 commit 8401387
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions rflink/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -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
Expand Down

0 comments on commit 8401387

Please sign in to comment.