-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
[Enum] update class creation for RuntimeError changes #111815
Conversation
prior to 3.12, an error that occurred during class creation, i.e. enum_class = super().__new__(metacls, cls, bases, classdict, **kwds) resulted in a RuntimeError being raised with the original exception as the __cause__. In 3.12, the original error is propagated with an extra line Error calling __set_name__ on '_proto_member' instance ... To discard that noise, the raised exception is recreated before being raised.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pending
Thanks @ethanfurman for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Thanks @ethanfurman for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Thanks @ethanfurman for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
(cherry picked from commit f9e6ce0) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
GH-112526 is a backport of this pull request to the 3.12 branch. |
prior to 3.12, an error that occurred during class creation, i.e.
resulted in a RuntimeError being raised with the original exception as the cause.
In 3.12, the original error is propagated with an extra line
To discard that noise, the raised exception is recreated before being raised.
📚 Documentation preview 📚: https://cpython-previews--111815.org.readthedocs.build/