-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-100762: Fix optimization in gen_close #111069
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
Conversation
yf
is NULL in gen_close in the cases where it is not DECREFed
yf
is NULL in gen_close in the cases where it is not DECREFedyf
is NULL
in the cases where it is not DECREFed
This looks good. Just change the test. |
One minor efficiency improvement that could be made is to not call |
yf
is NULL
in the cases where it is not DECREFed
Would it be possible / make sense to cherry-pick this change onto For pylint / astroid we're seeing |
I think so. I'll make a PR. |
Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
(cherry picked from commit 0db2517) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
GH-115818 is a backport of this pull request to the 3.12 branch. |
…GH-111069) (python#115818)" This reverts commit eb4774d.
In f02fa64 lines 383-389 were added, with returns that do not decref
yf
. I think this is ok becauseyf
is always NULL in these cases. Adding the assertions.Also, the optimization for the case of exception_handler_depth== 1 is not working because
op.code
is checked instead ofop.arg
.