Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Do not attempt to disconnect if there's no connection #472

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion rediscluster/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,8 @@ def _execute_command(self, *args, **kwargs):
redirect_addr, asking = "{0}:{1}".format(e.host, e.port), True
except BaseException as e:
log.exception("BaseException")
connection.disconnect()
if connection is not None:
connection.disconnect()
raise e
finally:
if connection is not None:
Expand Down