Skip to content

Commit

Permalink
Fix incrorect base class of ClientConnectorSSLError (#2563)
Browse files Browse the repository at this point in the history
  • Loading branch information
roganov authored and asvetlov committed Nov 27, 2017
1 parent 0fe3217 commit b7084cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES/2563.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change base class of ClientConnectorSSLError to ClientSSLError from ClientConnectorError.
4 changes: 2 additions & 2 deletions aiohttp/client_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b7084cf

Please sign in to comment.