gh-100762: Fix optimization in gen_close #111069
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 becauseyfis always NULL in these cases. Adding the assertions.Also, the optimization for the case of exception_handler_depth== 1 is not working because
op.codeis checked instead ofop.arg.