summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2019-10-11 10:46:51 -0700
committerAndy McCurdy <andy@andymccurdy.com>2019-10-11 10:46:51 -0700
commit5a69b82dd66964fa73e77d8d1f9a0e1f1e914403 (patch)
tree9ee8c7304e97440d645fee4ee7312a69cfaa330a
parente1bc3854dbce670652563d28d84bba0f333e2575 (diff)
downloadredis-py-ssl-py27-fix.tar.gz
check exception.args rather than exception.messagessl-py27-fix
-rw-r--r--redis/_compat.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/redis/_compat.py b/redis/_compat.py
index 5669454..2a4b2b9 100644
--- a/redis/_compat.py
+++ b/redis/_compat.py
@@ -98,7 +98,8 @@ if sys.version_info[0] < 3:
try:
return func(*args, **kwargs)
except _SSLError as e:
- if any(x in e.message for x in _EXPECTED_SSL_TIMEOUT_MESSAGES):
+ message = len(e.args) == 1 and unicode(e.args[0]) or ''
+ if any(x in message for x in _EXPECTED_SSL_TIMEOUT_MESSAGES):
# Raise socket.timeout for compatibility with Python 3.
raise socket.timeout(*e.args)
raise