Skip to content

Improvement: Use shutdown() Before close() in connection.py #3567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 26, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: remove whitespace
  • Loading branch information
allrob23 authored Mar 25, 2025
commit 1d673dc7357c1029bc6bb37b5cff15d1e686b8b8
3 changes: 1 addition & 2 deletions redis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ def _connect(self):
try:
sock.shutdown(socket.SHUT_RDWR) # ensure a clean close
except OSError:
pass
pass
sock.close()

if err is not None:
Expand Down Expand Up @@ -1187,7 +1187,6 @@ def _connect(self):
sock.shutdown(socket.SHUT_RDWR) # ensure a clean close
except OSError:
pass

sock.close()
raise
sock.settimeout(self.socket_timeout)
Expand Down