Skip to content

Commit 3afa016

Browse files
committed
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
1 parent 885ce77 commit 3afa016

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

redis/connection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from distutils.version import StrictVersion
33
from itertools import chain
44
from time import time
5+
import errno
56
import io
67
import os
78
import socket
@@ -35,7 +36,7 @@
3536
ssl_available = False
3637

3738
NONBLOCKING_EXCEPTION_ERROR_NUMBERS = {
38-
BlockingIOError: 35,
39+
BlockingIOError: errno.EWOULDBLOCK,
3940
}
4041

4142
if ssl_available:

0 commit comments

Comments
 (0)