diff --git a/CHANGES/2563.bugfix b/CHANGES/2563.bugfix new file mode 100644 index 00000000000..6c5b1e000fc --- /dev/null +++ b/CHANGES/2563.bugfix @@ -0,0 +1 @@ +Change base class of ClientConnectorSSLError to ClientSSLError from ClientConnectorError. diff --git a/aiohttp/client_exceptions.py b/aiohttp/client_exceptions.py index 350c58e9e47..9f70bd13990 100644 --- a/aiohttp/client_exceptions.py +++ b/aiohttp/client_exceptions.py @@ -175,13 +175,13 @@ class ClientSSLError(ClientConnectorError): certificate_errors_bases = (ClientSSLError, ssl.CertificateError,) ssl_errors = (ssl.SSLError,) - ssl_error_bases = (ClientConnectorError, ssl.SSLError) + ssl_error_bases = (ClientSSLError, ssl.SSLError) else: # pragma: no cover certificate_errors = tuple() certificate_errors_bases = (ClientSSLError, ValueError,) ssl_errors = tuple() - ssl_error_bases = (ClientConnectorError,) + ssl_error_bases = (ClientSSLError,) class ClientConnectorSSLError(*ssl_error_bases): diff --git a/tests/test_connector.py b/tests/test_connector.py index 8aaf6d0445f..b85d72d5d8b 100644 --- a/tests/test_connector.py +++ b/tests/test_connector.py @@ -1504,7 +1504,7 @@ def handler(request): self.loop.run_until_complete(session.request('get', url)) self.assertIsInstance(ctx.value.os_error, ssl.SSLError) - self.assertTrue(ctx.value, aiohttp.ClientSSLError) + self.assertIsInstance(ctx.value, aiohttp.ClientSSLError) session.close() conn.close()