]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-132775: Drop PyUnstable_InterpreterState_GetMainModule() (gh-132978)
authorEric Snow <ericsnowcurrently@gmail.com>
Mon, 28 Apr 2025 18:46:22 +0000 (12:46 -0600)
committerGitHub <noreply@github.com>
Mon, 28 Apr 2025 18:46:22 +0000 (12:46 -0600)
commitfe462f5a9122e1c2641b5369cbb88c4a5e822816
tree2ab97dcc3c793827bc1e620fa8d65d07a3df837a
parentc17238251fdf72861dfadcd581c77332b639bcb0
gh-132775: Drop PyUnstable_InterpreterState_GetMainModule() (gh-132978)

We replace it with _Py_GetMainModule(), and add _Py_CheckMainModule(), but both in the internal-only C-API.  We also add _PyImport_GetModulesRef(), which is the equivalent of _PyImport_GetModules(), but which increfs before the lock is released.

This is used by a later change related to pickle and handling __main__.
Doc/c-api/init.rst
Include/cpython/pystate.h
Include/internal/pycore_import.h
Include/internal/pycore_pystate.h
Python/crossinterp.c
Python/import.c
Python/pystate.c