Skip to content

Conversation

ZeroIntensity
Copy link
Member

@ZeroIntensity ZeroIntensity commented Sep 19, 2025

In the _interpreters module, we use PyEval_EvalCode to run Python code in another interpreter. However, when the process receives a KeyboardInterrupt, PyEval_EvalCode will jump straight to finalization rather than returning. This prevents us from cleaning up and marking the thread as "not running main", which triggers an assertion in PyThreadState_Clear on debug builds. Since everything else works as intended, remove that assertion.

@ZeroIntensity ZeroIntensity changed the title gh-126016: Remove assertion in PyThreadState_Clear gh-126016: Remove bad assertion in PyThreadState_Clear Sep 19, 2025
Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for doing this.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Sprint 2024 Sep 19, 2025
@ZeroIntensity ZeroIntensity added needs backport to 3.14 bugs and security fixes and removed needs backport to 3.14 bugs and security fixes labels Sep 19, 2025
@ZeroIntensity ZeroIntensity enabled auto-merge (squash) September 19, 2025 12:06
@ZeroIntensity ZeroIntensity merged commit 9243a4b into python:main Sep 19, 2025
59 checks passed
@ZeroIntensity ZeroIntensity deleted the subinterp-running-main branch September 19, 2025 12:17
@github-project-automation github-project-automation bot moved this from In Progress to Done in Sprint 2024 Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants