Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ def _create(cls, sock, server_side=False, do_handshake_on_connect=True,
self.getpeername()
except OSError as e:
if e.errno != errno.ENOTCONN:
self.close()
raise
connected = False
blocking = self.getblocking()
Expand All @@ -1030,6 +1031,7 @@ def _create(cls, sock, server_side=False, do_handshake_on_connect=True,
except OSError as e:
# EINVAL occurs for recv(1) on non-connected on unix sockets.
if e.errno not in (errno.ENOTCONN, errno.EINVAL):
self.close()
raise
notconn_pre_handshake_data = b''
self.setblocking(blocking)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix :class:`ResourceWarning` in :class:`ssl.SSLSocket` connected detection