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.
1 parent 6317ef5 commit d5c3428Copy full SHA for d5c3428
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:
770
+ pass
771
sock.close()
772
773
if err is not None:
@@ -1179,6 +1183,11 @@ def _connect(self):
1179
1183
sock.connect(self.path)
1180
1184
except OSError:
1181
1185
# Prevent ResourceWarnings for unclosed sockets.
1186
1187
1188
1189
1190
+
1182
1191
1192
raise
1193
sock.settimeout(self.socket_timeout)
0 commit comments