A minimal implementation of :external:exc:`ExceptionGroup` from Python 3.11. If :external:exc:`ExceptionGroup` is already defined by Python itself, that version is used instead.
| 28 | except NameError: # pragma: no cover |
| 29 | |
| 30 | class ExceptionGroup(Exception): # noqa: N818 |
| 31 | """A minimal implementation of :external:exc:`ExceptionGroup` from Python 3.11. |
| 32 | |
| 33 | If :external:exc:`ExceptionGroup` is already defined by Python itself, |
| 34 | that version is used instead. |
| 35 | """ |
| 36 | |
| 37 | message: str |
| 38 | exceptions: List[Exception] |
| 39 | |
| 40 | def __init__(self, message: str, exceptions: List[Exception]) -> None: |
| 41 | self.message = message |
| 42 | self.exceptions = exceptions |
| 43 | |
| 44 | def __repr__(self) -> str: |
| 45 | return f"{self.__class__.__name__}({self.message!r}, {self.exceptions!r})" |
| 46 | |
| 47 | else: # pragma: no cover |
| 48 | ExceptionGroup = ExceptionGroup |
no outgoing calls
no test coverage detected