]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-76785: Crossinterp utils additions (gh-111530)
authorEric Snow <ericsnowcurrently@gmail.com>
Wed, 1 Nov 2023 23:36:40 +0000 (17:36 -0600)
committerGitHub <noreply@github.com>
Wed, 1 Nov 2023 23:36:40 +0000 (17:36 -0600)
commit9322ce90ac8f4d4647a59bbfab48fad6f4e4e856
treec3dd4e202f02a639bca0412b71d1464fd4f624c5
parentcde1071b2a72e8261ca66053ef61431b7f3a81fd
gh-76785: Crossinterp utils additions (gh-111530)

This moves several general internal APIs out of _xxsubinterpretersmodule.c and into the new Python/crossinterp.c (and the corresponding internal headers).

Specifically:

* _Py_excinfo, etc.:  the initial implementation for non-object exception snapshots (in pycore_pyerrors.h and Python/errors.c)
* _PyXI_exception_info, etc.:  helpers for passing an exception beween interpreters (wraps _Py_excinfo)
* _PyXI_namespace, etc.:  helpers for copying a dict of attrs between interpreters
* _PyXI_Enter(), _PyXI_Exit():  functions that abstract out the transitions between one interpreter and a second that will do some work temporarily

Again, these were all abstracted out of _xxsubinterpretersmodule.c as generalizations.  I plan on proposing these as public API at some point.
Include/internal/pycore_crossinterp.h
Include/internal/pycore_interp.h
Include/internal/pycore_pyerrors.h
Include/internal/pycore_runtime.h
Include/internal/pycore_runtime_init.h
Lib/test/support/interpreters.py
Modules/_xxsubinterpretersmodule.c
Python/crossinterp.c
Python/errors.c
Python/pylifecycle.c
Python/pystate.c