Skip to content

Commit

Permalink
get_connection: catch OSError too (#1832)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enchufa2 committed Jan 10, 2022
1 parent 9a8674a commit 41cef47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ def get_connection(self, command_name, *keys, **options):
try:
if connection.can_read():
raise ConnectionError("Connection has data")
except ConnectionError:
except (ConnectionError, OSError):
connection.disconnect()
connection.connect()
if connection.can_read():
Expand Down

0 comments on commit 41cef47

Please sign in to comment.