Skip to content

gh-126986: Drop _PyInterpreterState_FailIfNotRunning() - #126988

Merged
ericsnowcurrently merged 2 commits into
python:mainfrom
ericsnowcurrently:drop-fail-if-running-main
Nov 19, 2024
Merged

gh-126986: Drop _PyInterpreterState_FailIfNotRunning()#126988
ericsnowcurrently merged 2 commits into
python:mainfrom
ericsnowcurrently:drop-fail-if-running-main

Conversation

@ericsnowcurrently

@ericsnowcurrentlyericsnowcurrently commented Nov 18, 2024

Copy link
Copy Markdown
Member

We replace it with _PyErr_SetInterpreterAlreadyRunning().

@ZeroIntensityZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I noticed this problem when working on some of the other issues, but it seems to not really occur in CI for whatever reason, so I don't think there's any point in trying to test for this. LGTM.

@ericsnowcurrently
ericsnowcurrently merged commit d6b3e78 into python:mainNov 19, 2024
@ericsnowcurrently
ericsnowcurrently deleted the drop-fail-if-running-main branch November 19, 2024 00:14
@ZeroIntensityZeroIntensity added the needs backport to 3.13 bugs and security fixes label Nov 19, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @ericsnowcurrently for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 19, 2024
…h-126988)
We replace it with _PyErr_SetInterpreterAlreadyRunning().
(cherry picked from commit d6b3e78)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
@bedevere-app

Copy link
Copy Markdown

GH-126995 is a backport of this pull request to the 3.13 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.13 bugs and security fixes label Nov 19, 2024
@ZeroIntensity

Copy link
Copy Markdown
Member

While this is a private API change, it's still technically breaking the ABI because of the PyAPI_FUNC() usage. I doubt that's a problem, but please let me know if backporting wasn't the right choice :)

@ericsnowcurrently

Copy link
Copy Markdown
MemberAuthor

It's okay. I'll sort out the ABI change. It's all internal ABI so we're safe to do it.

ericsnowcurrently added a commit to ericsnowcurrently/cpython that referenced this pull request Nov 21, 2024
…h-126988)
We replace it with _PyErr_SetInterpreterAlreadyRunning().
ericsnowcurrently added a commit that referenced this pull request Nov 21, 2024
…h-127112)
This is a pseudo-backport of d6b3e78 (gh-126988). In that change for 3.14+, we dropped _PyInterpreterState_FailIfNotRunning() and added _PyErr_SetInterpreterAlreadyRunning(). Here, we replace usage of _PyInterpreterState_FailIfNotRunning() with the inlined equivalent of _PyErr_SetInterpreterAlreadyRunning(), without adding that function. That way we avoid changing the 3.13 ABI.
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
…h-126988)
We replace it with _PyErr_SetInterpreterAlreadyRunning().
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ericsnowcurrently@ZeroIntensity