summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2019-07-30 15:35:02 -0700
committerAndy McCurdy <andy@andymccurdy.com>2019-07-30 15:35:02 -0700
commit3afa016029d7e0a46fa1d76ac9c7463a02495e05 (patch)
treed14ab17cf4157bb9aa16f83c7a736cfe2b9f4b4b
parent885ce770856a1ee5ebc51d7c5390c88fb62bc93e (diff)
downloadredis-py-3afa016029d7e0a46fa1d76ac9c7463a02495e05.tar.gz
version 3.3.4, more specifically identify nonblocking read errors3.3.4
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
-rwxr-xr-xredis/connection.py3
1 files changed, 2 insertions, 1 deletions
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: