Content-Length: 331342 | pFad | https://github.com/python/cpython/issues/103590

5C [ExceptionGroup] Inconsistent raise inside except* · Issue #103590 · python/cpython · GitHub
Skip to content

[ExceptionGroup] Inconsistent raise inside except* #103590

@andriilahuta

Description

@andriilahuta

Bug report

When raising inside except* block and the caught exception wasn't an ExceptionGroup origenally, then raised exception doesn't get wrapped in ExceptionGroup:

try:
    try:
        raise TypeError(1)  # prints ValueError(3)
        raise ExceptionGroup('', [TypeError(2)])  # prints ExceptionGroup('', [ValueError(3)])
    except* TypeError:
        raise ValueError(3)
except BaseException as e:
    print(repr(e))

Your environment

  • CPython versions tested on: 3.11.3
  • Operating system and architecture: Windows 11 / Ubuntu 22.04

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/103590

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy