From 47c7fedced71f420e3acb427993720ba66d9df65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Fri, 18 Feb 2022 16:37:03 +0100 Subject: [PATCH] Catch OSError in BlockingConnectionPool.get_connection --- redis/connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/connection.py b/redis/connection.py index 891695d31e..6bb80d9d0a 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -1570,7 +1570,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():