File size: 920 Bytes
870ab6b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
__all__ = [
"BaseExceptionGroup",
"ExceptionGroup",
"catch",
"format_exception",
"format_exception_only",
"print_exception",
"print_exc",
]
import os
import sys
from ._catch import catch
from ._version import version as __version__ # noqa: F401
if sys.version_info < (3, 11):
from ._exceptions import BaseExceptionGroup, ExceptionGroup
from ._formatting import (
format_exception,
format_exception_only,
print_exc,
print_exception,
)
if os.getenv("EXCEPTIONGROUP_NO_PATCH") != "1":
from . import _formatting # noqa: F401
BaseExceptionGroup.__module__ = __name__
ExceptionGroup.__module__ = __name__
else:
from traceback import (
format_exception,
format_exception_only,
print_exc,
print_exception,
)
BaseExceptionGroup = BaseExceptionGroup
ExceptionGroup = ExceptionGroup
|