| 224 | |
| 225 | |
| 226 | def raise_grouped_errors( |
| 227 | message: str, |
| 228 | first_error: BaseException, |
| 229 | second_error: BaseException, |
| 230 | *additional_errors: BaseException, |
| 231 | marker: tuple[str, _MarkerValue] | None = None, |
| 232 | ) -> NoReturn: |
| 233 | errors = (first_error, second_error, *additional_errors) |
| 234 | _detach_grouped_contexts(errors) |
| 235 | group: Final[BaseExceptionGroup[BaseException]] = BaseExceptionGroup(message, errors) |
| 236 | if marker is not None: |
| 237 | setattr(group, marker[0], marker[1]) |
| 238 | raise group from None |
| 239 | |
| 240 | |
| 241 | def _detach_grouped_contexts(errors: tuple[BaseException, ...]) -> None: |