Thanks to visit codestin.com
Credit goes to github.com

Skip to content

NameError: name 'ExceptionGroup' is not defined #4563

Closed
@torarvid

Description

@torarvid

Feature

This test file:

eg: ExceptionGroup = ExceptionGroup("test", [Exception("test1"), Exception("test2")])
print(eg)

yields the following in CPython 3.11.1:

❯ python test.py 
test (2 sub-exceptions)

and this error in RustPython v0.2.0

❯ rustpython test.py 
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    eg: ExceptionGroup = ExceptionGroup("test", [Exception("test1"), Exception("test2")])
NameError: name 'ExceptionGroup' is not defined

I discovered this when using ruff. I first created this ruff issue but now I believe this repo is where the issue might belong 🙂

Python Documentation

ExceptionGroup is now a Python builtin (new in 3.11)

https://docs.python.org/3/library/exceptions.html#exception-groups

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-vmArea: virtual machine

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions