提交 e1bc3854 编写于 作者: Z Zac Bristow 提交者: Andy McCurdy

Version 3.3.10

Fix SSL regression introduced in 3.3.9

The wrapper introduced to handle SSL timeout errors in Python 2.7
incorrectly assumed that instances of SSLError would always have a
string as their first element. The safer approach is to check the
message attribute on the error.
上级 a03c12e5
* 3.3.10
* Fixed a potential error handling bug for the SSLError -> TimeoutError
mapping introduced in 3.3.9. hanks @zbristow. #1224
* 3.3.9
* Mapped Python 2.7 SSLError to TimeoutError where appropriate. Timeouts
should now consistently raise TimeoutErrors on Python 2.7 for both
......
......@@ -29,7 +29,7 @@ def int_or_str(value):
return value
__version__ = '3.3.9'
__version__ = '3.3.10'
VERSION = tuple(map(int_or_str, __version__.split('.')))
__all__ = [
......
......@@ -98,7 +98,7 @@ if sys.version_info[0] < 3:
try:
return func(*args, **kwargs)
except _SSLError as e:
if any(x in e.args[0] for x in _EXPECTED_SSL_TIMEOUT_MESSAGES):
if any(x in e.message for x in _EXPECTED_SSL_TIMEOUT_MESSAGES):
# Raise socket.timeout for compatibility with Python 3.
raise socket.timeout(*e.args)
raise
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册