summaryrefslogtreecommitdiff
path: root/redis/connection.py
diff options
context:
space:
mode:
authorÉric Lemoine <eric.lemoine@gmail.com>2022-02-22 12:32:14 +0100
committerGitHub <noreply@github.com>2022-02-22 13:32:14 +0200
commit1983905d5adceaba2c3b27ba8f569dcb5387cc35 (patch)
treebb25ef02cc725ae9e1f890e6a3013a01bfdc792e /redis/connection.py
parentfa76ac49a9ea02c204bd4f1644f39d90140cf356 (diff)
downloadredis-py-1983905d5adceaba2c3b27ba8f569dcb5387cc35.tar.gz
Catch OSError in BlockingConnectionPool.get_connection (#2001)
Co-authored-by: Chayim I. Kirshen <c@kirshen.com>
Diffstat (limited to 'redis/connection.py')
-rwxr-xr-xredis/connection.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/redis/connection.py b/redis/connection.py
index 189cecb..8a77e4b 100755
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -1577,7 +1577,7 @@ class BlockingConnectionPool(ConnectionPool):
try:
if connection.can_read():
raise ConnectionError("Connection has data")
- except ConnectionError:
+ except (ConnectionError, OSError):
connection.disconnect()
connection.connect()
if connection.can_read():