from __future__ import absolute_import
from socket import error as SocketError, timeout as SocketTimeout
from six.moves.http_client import HTTPConnection as _HTTPConnection
from six.moves.http_client import HTTPException # noqa: F401
try: # Compiled with SSL?
BaseSSLError = ssl.SSLError
except (ImportError, AttributeError): # Platform-specific: No SSL.
class BaseSSLError(BaseException):
# Not a no-op, we're adding this to the namespace so it can be imported.
ConnectionError = ConnectionError
except NameError: # Python 2:
class ConnectionError(Exception):
from .exceptions import (
from .packages.ssl_match_hostname import match_hostname, CertificateError