exceptiongroup
Backport of PEP 654 (exception groups)
Install
exceptiongroup on PyPI
pip
pip install exceptiongroupuv
uv add exceptiongrouppoetry
poetry add exceptiongroupPackage 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
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.BaseExceptionGroupandexceptiongroup.ExceptionGroupclasses - A utility function (
exceptiongroup.catch()) for catching exceptions possibly nested in an exception group - Patches to the
TracebackExceptionclass 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
tracebackmodule, 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
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.
Similar packages
permissive · top 1,000 on PyPI
typeguardpermissive · top 1,000 on PyPI
nest-asynciopermissive · top 1,000 on PyPI
nest-asyncio2permissive · top 1,000 on PyPI
wraptpermissive · top 100 on PyPI
backports.asyncio.runnerpermissive · top 1,000 on PyPI
ipython-pygments-lexerspermissive · top 1,000 on PyPI
anyiopermissive · top 100 on PyPI
frozenlistpermissive · top 100 on PyPI
requests-oauthlibpermissive · top 1,000 on PyPI