skillfed

exceptiongroup

Backport of PEP 654 (exception groups)

exceptiongroup Permissive license Active 49 v1.3.1 released

Install

exceptiongroup on PyPI

pip

pip install exceptiongroup

uv

uv add exceptiongroup

poetry

poetry add exceptiongroup

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 1 — typing-extensions
Maintenance actively maintained — 265 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: exceptiongroup-1.3.1-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyTyping :: Typed

About exceptiongroup

from the package's own PyPI description — quoted content, verbatim

.. 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()...

Read as markdown · JSON record · Source repository

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

Backports Python 3.11's exception group classes and exception handling utilities to earlier Python versions, enabling structured handling of multiple exceptions raised together.

Low friction: single pure-Python wheel dependency on typing-extensions; actively maintained with recent releases and no known vulnerabilities.

Permissive MIT license allows unrestricted use, modification, and distribution in both open and closed-source projects.

Usage

pip install exceptiongroup

from exceptiongroup import catch, BaseExceptionGroup

def handler(excgroup: BaseExceptionGroup) -> None:
    for exc in excgroup.exceptions:
        print(f'Caught: {type(exc).__name__}')

with catch({ValueError: handler}):
    raise ExceptionGroup('errors', [ValueError('test')])

Requires Python 3.7 or later; on Python 3.11+ uses built-in implementations instead of backport.

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.

Needs verification

  • Whether the monkey-patching behavior (traceback.TracebackException patches, sys.excepthook installation) may conflict with other exception handling libraries in production environments.
  • Performance characteristics of exception group creation and handling compared to native Python 3.11+ implementations.
exception groups backportPEP 654 exception handlingnested exception handlingmultiple exceptions at onceexception group catchPython 3.11 exception groupsstructured exception handling

Similar packages