Skip to content

Commit f307878

Browse files
committed
Version 3.3.2, SSL Blocking Exceptions don't use errno.EWOULDBLOCK
Ref #1197
1 parent e897c17 commit f307878

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGES

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
* 3.3.2
2+
* Further fixed a regression introduced in 3.3.0 involving SSL and
3+
non-blocking sockets. #1197
14
* 3.3.1
2-
* Fixed a regression introduced in 3.3.1 involving SSL and non-blocking
5+
* Fixed a regression introduced in 3.3.0 involving SSL and non-blocking
36
sockets. #1197
47
* 3.3.0
58
* Resolve a race condition with the PubSubWorkerThread. #1150

redis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def int_or_str(value):
2929
return value
3030

3131

32-
__version__ = '3.3.1'
32+
__version__ = '3.3.2'
3333
VERSION = tuple(map(int_or_str, __version__.split('.')))
3434

3535
__all__ = [

redis/connection.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import unicode_literals
22
from distutils.version import StrictVersion
3-
from errno import EWOULDBLOCK
43
from itertools import chain
54
from time import time
65
import io
@@ -36,6 +35,8 @@
3635
ssl_available = False
3736

3837
if ssl_available:
38+
# note that when using nonblocking sockets over ssl, the ssl module
39+
# raises its own exceptions rather than the normal BlockingIOError
3940
blocking_exceptions = (
4041
BlockingIOError,
4142
ssl.SSLWantReadError,
@@ -184,7 +185,7 @@ def _read_from_socket(self, length=None, timeout=SENTINEL,
184185
# blocking error, simply return False indicating that
185186
# there's no data to be read. otherwise raise the
186187
# original exception.
187-
if raise_on_timeout or ex.errno != EWOULDBLOCK:
188+
if raise_on_timeout:
188189
raise
189190
return False
190191
except socket.timeout:
@@ -413,7 +414,7 @@ def read_from_socket(self, timeout=SENTINEL, raise_on_timeout=True):
413414
# blocking error, simply return False indicating that
414415
# there's no data to be read. otherwise raise the
415416
# original exception.
416-
if raise_on_timeout or ex.errno != EWOULDBLOCK:
417+
if raise_on_timeout:
417418
raise
418419
return False
419420
except socket.timeout:

0 commit comments

Comments
 (0)