Repository navigation
gh-130279: Fix missing exception handlers for jumps in loops - #159460
Open
LH-and-FPGA wants to merge 3 commits into
Open
LH-and-FPGA wants to merge 3 commits into
LH-and-FPGA wants to merge 3 commits into
Conversation
LH-and-FPGA
requested review from
Eclips4,
iritkatriel and
markshannon
as code owners
October 15, 2026 12:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a loop body ends with an
ifwhose false branch jumps back to the loop head, the backward jump ended up outside the exception table ranges of the enclosingtry/with. An exception raised when thatJUMP_BACKWARDchecks the eval breaker (e.g.KeyboardInterrupt, or an async exception set viaPyThreadState_SetAsyncExc) then skipped theexcept/finallyblocks, and__exit__was not called forwithblocks.Two places in Python/flowgraph.c created jump instructions without an exception handler after label_exception_targets() had already run:
Both now copy the handler of the original jump.
KeyboardInterruptnot handled while evaluating a tightwhileloop condition on Python 3.13 #130279