Skip to content

GH-148874: Make sure that mngr.__exit__() is always called in a with statement#150911

Open
markshannon wants to merge 3 commits into
python:mainfrom
markshannon:fix-call-in-with
Open

GH-148874: Make sure that mngr.__exit__() is always called in a with statement#150911
markshannon wants to merge 3 commits into
python:mainfrom
markshannon:fix-call-in-with

Conversation

@markshannon

@markshannon markshannon commented Jun 4, 2026

Copy link
Copy Markdown
Member

... even if there is an interrupt during the call to mngr.__enter__()

When checking the eval breaker after a call, don't break if the previous code unit has opcode == LOAD_SPECIAL.
Sometimes a cache will appear to be a LOAD_SPECIAL, but this is fine as this only applies to calls, and any loop will still have an eval breaker check on the back edge.

…even if there is an interrupt during the call to mngr.__enter__()
@markshannon markshannon added needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 1, 2026

@diegorusso diegorusso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. This was already reviewed internally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants