-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-34880: assert statement misbehavior if AssertionError is shadowed #15073
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
bpo-34880: assert statement misbehavior if AssertionError is shadowed #15073
Conversation
I'd like to keep any new bytecodes as simple as possible. The simplest I can think of is a |
I concur with @markshannon. There is no benefit from implementing it as a single bytecode: it is neither performance critical nor should be atomical. Using |
Thanks for all of the comments. I have implemented |
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.
It's better for "{" at the end of the previous line.
…onError-shadowing-assert
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.
LGTM, but it needs to wait until #15320 be merged.
Fix assert statement misbehavior if AssertionError is shadowed.
Fix assert statement misbehavior if AssertionError is shadowed.
Fix assert statement misbehavior if AssertionError is shadowed.
The assert statement was not working properly if the AssertionError
exception was being shadowed.
https://bugs.python.org/issue34880