]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-76785: Handle Legacy Interpreters Properly (gh-117490)
authorEric Snow <ericsnowcurrently@gmail.com>
Thu, 11 Apr 2024 23:23:25 +0000 (17:23 -0600)
committerGitHub <noreply@github.com>
Thu, 11 Apr 2024 23:23:25 +0000 (23:23 +0000)
commitfd259fdabe95329768eb3e90039c77888c130a4c
treef4e564a993f0bf702c884ba3e96bdbb6e968fccb
parentfd2bab9d287ef0879568662d4fedeae0a0c61d43
gh-76785: Handle Legacy Interpreters Properly (gh-117490)

This is similar to the situation with threading._DummyThread.  The methods (incl. __del__()) of interpreters.Interpreter objects must be careful with interpreters not created by interpreters.create().  The simplest thing to start with is to disable any method that modifies or runs in the interpreter.  As part of this, the runtime keeps track of where an interpreter was created.  We also handle interpreter "refcounts" properly.
Include/internal/pycore_crossinterp.h
Include/internal/pycore_interp.h
Lib/test/support/interpreters/__init__.py
Lib/test/test_interpreters/test_api.py
Lib/test/test_interpreters/utils.py
Modules/_testinternalcapi.c
Modules/_xxsubinterpretersmodule.c
Python/crossinterp.c
Python/pystate.c