Skip to content

gh-120838: Disallow Py_Finalize() if Py_RunMain() is Running #120841

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Jun 21, 2024

Py_RunMain() is responsible for finalizing the runtime. Extension modules should never call Py_Finalize(). Enforcing this helps keep finalization conceptually simpler and helps get closer to making the Py_Finalize() implementation simpler in practice.

Note that the relevant docs change is part of gh-120839.

@ericsnowcurrently
Copy link
Member Author

@ncoghlan, any objections to this change?

@ericsnowcurrently
Copy link
Member Author

CC @vstinner

@ericsnowcurrently ericsnowcurrently added the needs backport to 3.13 bugs and security fixes label Jun 25, 2024
This reverts commit d5dc13a.
@ericsnowcurrently ericsnowcurrently removed the needs backport to 3.13 bugs and security fixes label Jun 25, 2024
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.

1 participant