]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-132775: Fix Interpreter.call() __main__ Visibility (gh-135595)
authorEric Snow <ericsnowcurrently@gmail.com>
Tue, 17 Jun 2025 19:16:59 +0000 (13:16 -0600)
committerGitHub <noreply@github.com>
Tue, 17 Jun 2025 19:16:59 +0000 (13:16 -0600)
commit269e19e0a7efc62ee4ffbd8424974dc6d4fbfd5d
treedcec620e1d962eda134c55ad1de0696c697dabef
parentfba5dded6df3c2b1943557afef89a5cb418f65a2
gh-132775: Fix Interpreter.call() __main__ Visibility (gh-135595)

As noted in the new tests, there are a few situations we must carefully accommodate
for functions that get pickled during interp.call().  We do so by running the script
from the main interpreter's __main__ module in a hidden module in the other
interpreter.  That hidden module is used as the function __globals__.
Lib/test/test_interpreters/test_api.py
Modules/_interpretersmodule.c
Python/crossinterp.c
Python/pystate.c