Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/exceptiongroup/__init__.py: 78%
18 statements
« prev ^ index » next coverage.py v7.4.0, created at 2024-01-07 06:33 +0000
« prev ^ index » next coverage.py v7.4.0, created at 2024-01-07 06:33 +0000
1__all__ = [
2 "BaseExceptionGroup",
3 "ExceptionGroup",
4 "catch",
5 "format_exception",
6 "format_exception_only",
7 "print_exception",
8 "print_exc",
9 "suppress",
10]
12import os
13import sys
15from ._catch import catch
16from ._version import version as __version__ # noqa: F401
18if sys.version_info < (3, 11):
19 from ._exceptions import BaseExceptionGroup, ExceptionGroup
20 from ._formatting import (
21 format_exception,
22 format_exception_only,
23 print_exc,
24 print_exception,
25 )
27 if os.getenv("EXCEPTIONGROUP_NO_PATCH") != "1":
28 from . import _formatting # noqa: F401
30 BaseExceptionGroup.__module__ = __name__
31 ExceptionGroup.__module__ = __name__
32else:
33 from traceback import (
34 format_exception,
35 format_exception_only,
36 print_exc,
37 print_exception,
38 )
40 BaseExceptionGroup = BaseExceptionGroup
41 ExceptionGroup = ExceptionGroup
43if sys.version_info < (3, 12, 1):
44 from ._suppress import suppress
45else:
46 from contextlib import suppress