Skip to content

gh-126986: Drop _PyInterpreterState_FailIfNotRunning() #126988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Nov 18, 2024

We replace it with _PyErr_SetInterpreterAlreadyRunning().

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

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:main Nov 19, 2024
41 checks passed
@ericsnowcurrently ericsnowcurrently deleted the drop-fail-if-running-main branch November 19, 2024 00:14
@ZeroIntensity ZeroIntensity added the needs backport to 3.13 bugs and security fixes label Nov 19, 2024
@miss-islington-app
Copy link

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 <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Nov 19, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 19, 2024
@ZeroIntensity
Copy link
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
Member Author

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 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