We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
shutdown()
close()
1 parent ee54d2a commit c42df94Copy full SHA for c42df94
redis/connection.py
@@ -764,6 +764,10 @@ def _connect(self):
764
except OSError as _:
765
err = _
766
if sock is not None:
767
+ try:
768
+ sock.shutdown(socket.SHUT_RDWR) # ensure a clean close
769
+ except OSError:
770
+ pass
771
sock.close()
772
773
if err is not None:
@@ -1179,6 +1183,10 @@ def _connect(self):
1179
1183
sock.connect(self.path)
1180
1184
except OSError:
1181
1185
# Prevent ResourceWarnings for unclosed sockets.
1186
1187
1188
1189
1182
1190
1191
raise
1192
sock.settimeout(self.socket_timeout)
0 commit comments