Skip to content

NameError: name 'ExceptionGroup' is not defined #4563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
torarvid opened this issue Feb 24, 2023 · 3 comments
Closed

NameError: name 'ExceptionGroup' is not defined #4563

torarvid opened this issue Feb 24, 2023 · 3 comments
Labels
A-vm Area: virtual machine

Comments

@torarvid
Copy link

torarvid commented Feb 24, 2023

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

@DimitrisJim DimitrisJim added the A-vm Area: virtual machine label Feb 24, 2023
@DimitrisJim
Copy link
Member

DimitrisJim commented Feb 24, 2023

this repo is where the issue might belong

It definitely is, thanks for reporting! We just recently bumped to using 3.11 so some things aren't here yet. Adding these shouldn't be too difficult though, just adding the names alone (for now) would fix this issue.

@arihant2math
Copy link
Collaborator

Exception groups have been added now.

@youknowone
Copy link
Member

#5254 added it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vm Area: virtual machine
Projects
None yet
Development

No branches or pull requests

4 participants