Skip to content

Commit a1e8bbb

Browse files
committed
Catch OSError to avoid socket leak
1 parent f658b39 commit a1e8bbb

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)