Skip to content

Conversation

@ZeroIntensity
Copy link
Member

@ZeroIntensityZeroIntensity 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.

@ZeroIntensityZeroIntensity changed the title gh-126016: Remove assertion in PyThreadState_Cleargh-126016: Remove bad assertion in PyThreadState_ClearSep 19, 2025
Copy link
Member

@ericsnowcurrentlyericsnowcurrently 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-automationgithub-project-automationbot moved this from Todo to In Progress in Sprint 2024Sep 19, 2025
@ZeroIntensityZeroIntensity 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
@ZeroIntensityZeroIntensity enabled auto-merge (squash) September 19, 2025 12:06
@ZeroIntensityZeroIntensity merged commit 9243a4b into python:mainSep 19, 2025
59 checks passed
@ZeroIntensityZeroIntensity deleted the subinterp-running-main branch September 19, 2025 12:17
@github-project-automationgithub-project-automationbot moved this from In Progress to Done in Sprint 2024Sep 19, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants

@ZeroIntensity@ericsnowcurrently