Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.9/dist-packages/exceptiongroup/__init__.py: 80%

15 statements  

« prev     ^ index     » next       coverage.py v7.3.1, created at 2023-09-25 06:05 +0000

1__all__ = [ 

2 "BaseExceptionGroup", 

3 "ExceptionGroup", 

4 "catch", 

5 "format_exception", 

6 "format_exception_only", 

7 "print_exception", 

8 "print_exc", 

9] 

10 

11import os 

12import sys 

13 

14from ._catch import catch 

15from ._version import version as __version__ # noqa: F401 

16 

17if sys.version_info < (3, 11): 

18 from ._exceptions import BaseExceptionGroup, ExceptionGroup 

19 from ._formatting import ( 

20 format_exception, 

21 format_exception_only, 

22 print_exc, 

23 print_exception, 

24 ) 

25 

26 if os.getenv("EXCEPTIONGROUP_NO_PATCH") != "1": 

27 from . import _formatting # noqa: F401 

28 

29 BaseExceptionGroup.__module__ = __name__ 

30 ExceptionGroup.__module__ = __name__ 

31else: 

32 from traceback import ( 

33 format_exception, 

34 format_exception_only, 

35 print_exc, 

36 print_exception, 

37 ) 

38 

39 BaseExceptionGroup = BaseExceptionGroup 

40 ExceptionGroup = ExceptionGroup