Skip to content

Commit 16b848d

Browse files
klocsdhalbert
andauthored
Update adafruit_requests.py
Co-authored-by: Dan Halbert <halbert@halwitz.org>
1 parent cfacf13 commit 16b848d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_requests.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ def _throw_away(self, nbytes: int) -> None:
319319
buf = self._receive_buffer
320320
len_buf = len(buf)
321321
for _ in range(nbytes // len_buf):
322-
read = 0
323-
while read < len_buf:
324-
read += self._recv_into(buf, len_buf - read)
322+
to_read = len_buf
323+
while to_read > 0:
324+
to_read -= self._recv_into(buf, to_read)
325325
remaining = nbytes % len_buf
326326
if remaining:
327327
read = 0

0 commit comments

Comments
 (0)