__init__.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # -*- coding: utf-8 -*-
  2. """
  3. The root of the greenlet package.
  4. """
  5. from __future__ import absolute_import
  6. from __future__ import division
  7. from __future__ import print_function
  8. __all__ = [
  9. '__version__',
  10. '_C_API',
  11. 'GreenletExit',
  12. 'error',
  13. 'getcurrent',
  14. 'greenlet',
  15. 'gettrace',
  16. 'settrace',
  17. ]
  18. # pylint:disable=no-name-in-module
  19. ###
  20. # Metadata
  21. ###
  22. __version__ = '1.1.2'
  23. from ._greenlet import _C_API # pylint:disable=no-name-in-module
  24. ###
  25. # Exceptions
  26. ###
  27. from ._greenlet import GreenletExit
  28. from ._greenlet import error
  29. ###
  30. # greenlets
  31. ###
  32. from ._greenlet import getcurrent
  33. from ._greenlet import greenlet
  34. ###
  35. # tracing
  36. ###
  37. try:
  38. from ._greenlet import gettrace
  39. from ._greenlet import settrace
  40. except ImportError:
  41. # Tracing wasn't supported.
  42. # XXX: The option to disable it was removed in 1.0,
  43. # so this branch should be dead code.
  44. pass
  45. ###
  46. # Constants
  47. # These constants aren't documented and aren't recommended.
  48. # In 1.0, USE_GC and USE_TRACING are always true, and USE_CONTEXT_VARS
  49. # is the same as ``sys.version_info[:2] >= 3.7``
  50. ###
  51. from ._greenlet import GREENLET_USE_CONTEXT_VARS # pylint:disable=unused-import
  52. from ._greenlet import GREENLET_USE_GC # pylint:disable=unused-import
  53. from ._greenlet import GREENLET_USE_TRACING # pylint:disable=unused-import