Skip to content

Commit 739aac5

Browse files
committed
Handle send returning None like ESP32SPI does
1 parent 9607753 commit 739aac5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

adafruit_requests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ def _send(self, socket, data):
446446
total_sent = 0
447447
while total_sent < len(data):
448448
sent = socket.send(data[total_sent:])
449+
if sent is None:
450+
sent = len(data)
449451
if sent == 0:
450452
raise RuntimeError("Connection closed")
451453
total_sent += sent

0 commit comments

Comments
 (0)