Skip to content

gh-132775: Drop PyUnstable_InterpreterState_GetMainModule() #132978

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

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Apr 25, 2025

We replace it with _Py_GetMainModule(), and add _Py_CheckMainModule(), but in the internal-only C-API. We also add _PyImport_GetModulesRef(), which is the equivalent of _PyImport_GetModules() that incref's while the lock is held.

This is used by a later change related to pickle and handling __main__.


📚 Documentation preview 📚: https://cpython-previews--132978.org.readthedocs.build/

@ericsnowcurrently ericsnowcurrently force-pushed the replace-pyUnstable_interpreterstate_get-main-module branch from ed0d690 to 9c9c41c Compare April 25, 2025 23:02
@ericsnowcurrently ericsnowcurrently merged commit fe462f5 into python:main Apr 28, 2025
42 checks passed
@ericsnowcurrently ericsnowcurrently deleted the replace-pyUnstable_interpreterstate_get-main-module branch April 28, 2025 18:46
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