--- id: exceptiongroup version: "1.3.1" license: unclear license_treatment: permissive maintenance: active --- # exceptiongroup — Backport of PEP 654 (exception groups) License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install exceptiongroup uv add exceptiongroup poetry add exceptiongroup ## Description .. image:: https://github.com/agronholm/exceptiongroup/actions/workflows/test.yml/badge.svg :target: https://github.com/agronholm/exceptiongroup/actions/workflows/test.yml :alt: Build Status .. image:: https://coveralls.io/repos/github/agronholm/exceptiongroup/badge.svg?branch=main :target: https://coveralls.io/github/agronholm/exceptiongroup?branch=main :alt: Code Coverage This is a backport of the ``BaseExceptionGroup`` and ``ExceptionGroup`` classes from Python 3.11. It contains the following: * The ``exceptiongroup.BaseExceptionGroup`` and ``exceptiongroup.ExceptionGroup`` classes * A utility function (``exceptiongroup.catch()``) for catching exceptions possibly nested in an exception group * Patches to the ``TracebackException`` class that properly formats exception groups (installed on import) * An exception hook that handles formatting of exception groups through ``TracebackException`` (installed on import) * Special versions of some of the functions from the ``traceback`` module, modified to correctly handle exception groups even when monkey patching is disabled, or blocked by another custom exception hook: * ``traceback.format_exception()``... ## AI interpretation — verify before relying Backports Python 3.11's exception group classes and exception handling utilities to earlier Python versions, enabling structured handling of multiple exceptions raised together. Verdict: Stable, actively maintained backport of Python 3.11 exception groups for earlier versions. Zero security issues, minimal dependencies, and permissive licensing make it a safe choice for projects needing structured exception handling across Python versions. [View on SkillFed](https://skillfed.io/packages/exceptiongroup) · [View on PyPI](https://pypi.org/project/exceptiongroup/)