summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmer Katz <omer.drow@gmail.com>2020-08-30 18:29:05 +0300
committerAsif Saif Uddin <auvipy@gmail.com>2020-08-31 14:05:09 +0600
commit73dc499275a0e2216ff9d3c3af575bfed0539b80 (patch)
treeb297c0027a95a53e0cf763444dc7f4dcd2f9f28c
parentd6b758ca49bad3f09f449f570c65758fc07c0ac2 (diff)
downloadpy-amqp-73dc499275a0e2216ff9d3c3af575bfed0539b80.tar.gz
Python issue 10272 has been fixed in Python 3.1.
See http://bugs.python.org/issue10272 for details.
-rw-r--r--amqp/transport.py4
-rw-r--r--t/unit/test_transport.py2
2 files changed, 1 insertions, 5 deletions
diff --git a/amqp/transport.py b/amqp/transport.py
index c7d82fc..c873384 100644
--- a/amqp/transport.py
+++ b/amqp/transport.py
@@ -389,10 +389,6 @@ class SSLTransport(_AbstractTransport):
try:
s = recv(n - len(rbuf)) # see note above
except socket.error as exc:
- # ssl.sock.read may cause a SSLerror without errno
- # http://bugs.python.org/issue10272
- if isinstance(exc, SSLError) and 'timed out' in str(exc):
- raise socket.timeout()
# ssl.sock.read may cause ENOENT if the
# operation couldn't be performed (Issue celery#1414).
if exc.errno in _errnos:
diff --git a/t/unit/test_transport.py b/t/unit/test_transport.py
index 7aa703b..09e341c 100644
--- a/t/unit/test_transport.py
+++ b/t/unit/test_transport.py
@@ -672,7 +672,7 @@ class test_SSLTransport:
def test_read_SSLError(self):
self.t.sock = Mock(name='SSLSocket')
self.t._quick_recv = Mock(name='recv', return_value='4')
- self.t._quick_recv.side_effect = transport.SSLError('timed out')
+ self.t._quick_recv.side_effect = socket.timeout()
self.t._read_buffer = MagicMock(return_value='AA')
with pytest.raises(socket.timeout):
self.t._read(64)