PYTHON-3691 [Build Failure] test_client.TestClient.test_exhaust_network_error (#1216)

This commit is contained in:
Steven Silvester 2023-06-05 12:03:51 -05:00 committed by GitHub
parent 2fe01929e9
commit 5831934b37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,6 +107,11 @@ class _sslConn(_SSL.Connection):
try:
return call(*args, **kwargs)
except BLOCKING_IO_ERRORS as exc:
# Check for closed socket.
if self.fileno() == -1:
if timeout and _time.monotonic() - start > timeout:
raise _socket.timeout("timed out")
raise SSLError("Underlying socket has been closed")
if isinstance(exc, _SSL.WantReadError):
want_read = True
want_write = False