summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2019-07-30 14:01:23 -0700
committerAndy McCurdy <andy@andymccurdy.com>2019-07-30 14:01:23 -0700
commitf966b64f92b99f57dbcab1a870e022da03d81aa0 (patch)
tree9e2d931b02c8a97807c071e71c3ca47f85ecea62
parentc1b99413d4c277c2b18a8ce3282d7aa9ecdd5ef3 (diff)
downloadredis-py-f966b64f92b99f57dbcab1a870e022da03d81aa0.tar.gz
Version 3.3.3. Accomodate Python 2.7.x versions < 2.7.9.3.3.3
The SSL module includes in Python versions < 2.7.9 does not include the SSLWantReadError or SSLWantWriteError exceptions. As such we can't assume they are present just because the ssl module happens to be installed. Fixes #1197
-rw-r--r--CHANGES3
-rw-r--r--redis/__init__.py2
-rwxr-xr-xredis/connection.py4
3 files changed, 6 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 8c29266..53786d0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+* 3.3.3
+ * The SSL module in Python < 2.7.9 handles non-blocking sockets
+ differently than 2.7.9+. This patch accomodates older versions. #1197
* 3.3.2
* Further fixed a regression introduced in 3.3.0 involving SSL and
non-blocking sockets. #1197
diff --git a/redis/__init__.py b/redis/__init__.py
index 234bd65..2d586c6 100644
--- a/redis/__init__.py
+++ b/redis/__init__.py
@@ -29,7 +29,7 @@ def int_or_str(value):
return value
-__version__ = '3.3.2'
+__version__ = '3.3.3'
VERSION = tuple(map(int_or_str, __version__.split('.')))
__all__ = [
diff --git a/redis/connection.py b/redis/connection.py
index 46d3b20..e753bcb 100755
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -34,9 +34,9 @@ try:
except ImportError:
ssl_available = False
-if ssl_available:
+if ssl_available and hasattr(ssl, 'SSLWantReadError'):
# note that when using nonblocking sockets over ssl, the ssl module
- # raises its own exceptions rather than the normal BlockingIOError
+ # in python > 2.7.9 raises its own exceptions rather than BlockingIOError
blocking_exceptions = (
BlockingIOError,
ssl.SSLWantReadError,