Skip to content

Commit 40c3498

Browse files
authored
Merge branch 'adafruit:main' into jerryn_listen
2 parents 8e87ca5 + e242320 commit 40c3498

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

adafruit_rfm/rfm_common.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,6 @@ async def asyncio_send( # noqa: PLR0912 PLR0913
286286
287287
Returns: True if success or False if the send timed out.
288288
"""
289-
# Disable pylint warning to not use length as a check for zero.
290-
# This is a puzzling warning as the below code is clearly the most
291-
# efficient and proper way to ensure a precondition that the provided
292-
# buffer be within an expected range of bounds. Disable this check.
293-
# pylint: disable=len-as-condition
294-
assert 0 < len(data) <= self.max_packet_length
295-
# pylint: enable=len-as-condition
296289
self.idle() # Stop receiving to clear FIFO and keep it clear.
297290
# Combine header and data to form payload
298291
if self.radiohead:
@@ -318,6 +311,13 @@ async def asyncio_send( # noqa: PLR0912 PLR0913
318311
payload = destination.to_bytes(1, "big") + data
319312
else:
320313
payload = data
314+
# Disable pylint warning to not use length as a check for zero.
315+
# This is a puzzling warning as the below code is clearly the most
316+
# efficient and proper way to ensure a precondition that the provided
317+
# buffer be within an expected range of bounds. Disable this check.
318+
# pylint: disable=len-as-condition
319+
assert 0 < len(payload) <= self.max_packet_length
320+
# pylint: enable=len-as-condition
321321
self.fill_fifo(payload)
322322
# Turn on transmit mode to send out the packet.
323323
self.transmit()

0 commit comments

Comments
 (0)