Skip to content

[3.14] gh-146480: Override the exception in _PyErr_SetKeyError() (GH-146486)#146511

Merged
vstinner merged 1 commit intopython:3.14from
miss-islington:backport-d4153a9-3.14
Mar 27, 2026
Merged

[3.14] gh-146480: Override the exception in _PyErr_SetKeyError() (GH-146486)#146511
vstinner merged 1 commit intopython:3.14from
miss-islington:backport-d4153a9-3.14

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented Mar 27, 2026

If _PyErr_SetKeyError() is called with an exception set, it now
replaces the current exception with KeyError (as expected), instead
of setting a SystemError or failing with a fatal error (in debug
mode).
(cherry picked from commit d4153a9)

Co-authored-by: Victor Stinner [email protected]

…onGH-146486)

If _PyErr_SetKeyError() is called with an exception set, it now
replaces the current exception with KeyError (as expected), instead
of setting a SystemError or failing with a fatal error (in debug
mode).
(cherry picked from commit d4153a9f76736128306c4af01776729da846d926)

Co-authored-by: Victor Stinner <[email protected]>
@vstinner vstinner enabled auto-merge (squash) March 27, 2026 11:21
@vstinner vstinner merged commit d7e04e7 into python:3.14 Mar 27, 2026
50 checks passed
@miss-islington miss-islington deleted the backport-d4153a9-3.14 branch March 27, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants