File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff 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 ()
You can’t perform that action at this time.
0 commit comments