diff --git a/asyncio/base_events.py b/asyncio/base_events.py index aa783671..711a2963 100644 --- a/asyncio/base_events.py +++ b/asyncio/base_events.py @@ -37,6 +37,11 @@ from .coroutines import coroutine from .log import logger +try: + import ssl +except ImportError: + ssl = None + __all__ = ['BaseEventLoop'] @@ -53,6 +58,8 @@ # methods (_fatal_error()) _FATAL_ERROR_IGNORE = (BrokenPipeError, ConnectionResetError, ConnectionAbortedError) +if ssl is not None: + _FATAL_ERROR_IGNORE = _FATAL_ERROR_IGNORE + (ssl.CertificateError,) def _format_handle(handle):