Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/greenlet/__init__.py: 91%

22 statements  

« prev     ^ index     » next       coverage.py v7.0.1, created at 2022-12-25 06:11 +0000

1# -*- coding: utf-8 -*- 

2""" 

3The root of the greenlet package. 

4""" 

5from __future__ import absolute_import 

6from __future__ import division 

7from __future__ import print_function 

8 

9__all__ = [ 

10 '__version__', 

11 '_C_API', 

12 

13 'GreenletExit', 

14 'error', 

15 

16 'getcurrent', 

17 'greenlet', 

18 

19 'gettrace', 

20 'settrace', 

21] 

22 

23# pylint:disable=no-name-in-module 

24 

25### 

26# Metadata 

27### 

28__version__ = '2.0.1' 

29from ._greenlet import _C_API # pylint:disable=no-name-in-module 

30 

31### 

32# Exceptions 

33### 

34from ._greenlet import GreenletExit 

35from ._greenlet import error 

36 

37### 

38# greenlets 

39### 

40from ._greenlet import getcurrent 

41from ._greenlet import greenlet 

42 

43### 

44# tracing 

45### 

46try: 

47 from ._greenlet import gettrace 

48 from ._greenlet import settrace 

49except ImportError: 

50 # Tracing wasn't supported. 

51 # XXX: The option to disable it was removed in 1.0, 

52 # so this branch should be dead code. 

53 pass 

54 

55### 

56# Constants 

57# These constants aren't documented and aren't recommended. 

58# In 1.0, USE_GC and USE_TRACING are always true, and USE_CONTEXT_VARS 

59# is the same as ``sys.version_info[:2] >= 3.7`` 

60### 

61from ._greenlet import GREENLET_USE_CONTEXT_VARS # pylint:disable=unused-import 

62from ._greenlet import GREENLET_USE_GC # pylint:disable=unused-import 

63from ._greenlet import GREENLET_USE_TRACING # pylint:disable=unused-import 

64 

65# Controlling the use of the gc module. Provisional API for this greenlet 

66# implementation in 2.0. 

67from ._greenlet import CLOCKS_PER_SEC # pylint:disable=unused-import 

68from ._greenlet import enable_optional_cleanup # pylint:disable=unused-import 

69from ._greenlet import get_clocks_used_doing_optional_cleanup # pylint:disable=unused-import 

70 

71# Other APIS in the _greenlet module are for test support.