-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
gh-99181: fix except* on unhashable exceptions #99192
Conversation
🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit 47842ab 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
47842ab
to
e725f63
Compare
🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit 9f8a78d 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
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.
Using the ids here seems safe because they are used only while the code holds a reference to the BaseExceptionGroup object and that object is immutable, so there's no chance that the ids will get reused while the code is running.
Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
(cherry picked from commit c43714f) Co-authored-by: Irit Katriel <[email protected]>
GH-99243 is a backport of this pull request to the 3.11 branch. |
(cherry picked from commit c43714f) Co-authored-by: Irit Katriel <[email protected]>
Fixes #99181.
The fix is for the internal split/merge that except* uses to be based on a set of the IDs of the exceptions rather than a set of the exception objects themselves. This also protects against exceptions with crazy
__eq__
implementations (the new tests check for this too).TypeError
whenexcept*
catches an unhashable exception #99181