Skip to content

Commit 7b1fc6f

Browse files
authored
Merge pull request #70 from anecdata/outofsockets
Catch OSError to avoid socket leak
2 parents f658b39 + a1e8bbb commit 7b1fc6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ def request(
560560
ok = True
561561
try:
562562
self._send_request(socket, host, method, path, headers, data, json)
563-
except _SendFailed:
563+
except (_SendFailed, OSError):
564564
ok = False
565565
if ok:
566566
# Read the H of "HTTP/1.1" to make sure the socket is alive. send can appear to work

0 commit comments

Comments
 (0)