__init__.py 844 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # flake8: noqa: F401
  2. import warnings
  3. from .common import (
  4. HEADRequest,
  5. PUTRequest,
  6. Request,
  7. RequestDirector,
  8. RequestHandler,
  9. Response,
  10. )
  11. # isort: split
  12. # TODO: all request handlers should be safely imported
  13. from . import _urllib
  14. from ..utils import bug_reports_message
  15. try:
  16. from . import _requests
  17. except ImportError:
  18. pass
  19. except Exception as e:
  20. warnings.warn(f'Failed to import "requests" request handler: {e}' + bug_reports_message())
  21. try:
  22. from . import _websockets
  23. except ImportError:
  24. pass
  25. except Exception as e:
  26. warnings.warn(f'Failed to import "websockets" request handler: {e}' + bug_reports_message())
  27. try:
  28. from . import _curlcffi
  29. except ImportError:
  30. pass
  31. except Exception as e:
  32. warnings.warn(f'Failed to import "curl_cffi" request handler: {e}' + bug_reports_message())