__init__.py 887 B

123456789101112131415161718192021222324252627282930313233343536
  1. # -*- coding: utf-8 -*-
  2. """
  3. hyper
  4. ~~~~~~
  5. A module for providing an abstraction layer over the differences between
  6. HTTP/1.1 and HTTP/2.
  7. """
  8. import logging
  9. from .common.connection import HTTPConnection
  10. from .http20.connection import HTTP20Connection
  11. from .http20.response import HTTP20Response, HTTP20Push
  12. from .http11.connection import HTTP11Connection
  13. from .http11.response import HTTP11Response
  14. # Throw import errors on Python <2.7 and 3.0-3.2.
  15. import sys as _sys
  16. if _sys.version_info < (2, 7) or (3, 0) <= _sys.version_info < (3, 3):
  17. raise ImportError(
  18. "hyper only supports Python 2.7 and Python 3.3 or higher."
  19. )
  20. __all__ = [
  21. HTTPConnection,
  22. HTTP20Response,
  23. HTTP20Push,
  24. HTTP20Connection,
  25. HTTP11Connection,
  26. HTTP11Response,
  27. ]
  28. # Set default logging handler.
  29. logging.getLogger(__name__).addHandler(logging.NullHandler())
  30. __version__ = '0.7.0'