From 3afa016029d7e0a46fa1d76ac9c7463a02495e05 Mon Sep 17 00:00:00 2001 From: Andy McCurdy Date: Tue, 30 Jul 2019 15:35:02 -0700 Subject: version 3.3.4, more specifically identify nonblocking read errors versions 3.3.1, 3.3.2 and 3.3.3 could potentially hide ConnectionErrors on Python 2.7. This change accurately identifies errors by both exception class and errno to determine whether a nonblocking socket can be read --- redis/connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/redis/connection.py b/redis/connection.py index 8b87ead..28b579e 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -2,6 +2,7 @@ from __future__ import unicode_literals from distutils.version import StrictVersion from itertools import chain from time import time +import errno import io import os import socket @@ -35,7 +36,7 @@ except ImportError: ssl_available = False NONBLOCKING_EXCEPTION_ERROR_NUMBERS = { - BlockingIOError: 35, + BlockingIOError: errno.EWOULDBLOCK, } if ssl_available: -- cgit v1.2.1