Skip to content

Backport changes to contextlib.suppress()? #91

@Zac-HD

Description

@Zac-HD

python/cpython#103792 modified contextlib.suppress() to support ExceptionGroups, by removing suppressed exceptions. If there are no remaining exceptions in the group it's caught; otherwise the remainder is re-raised.

It seems useful to provide this behavior to exceptiongroup users on Python < 3.12 (notably including 3.11, where ExceptionGroup is built in but suppress() did not handle it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions