]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40453: Add PyConfig._isolated_subinterpreter (GH-19820)
authorVictor Stinner <vstinner@python.org>
Fri, 1 May 2020 09:33:44 +0000 (11:33 +0200)
committerGitHub <noreply@github.com>
Fri, 1 May 2020 09:33:44 +0000 (11:33 +0200)
commit252346acd937ddba4845331994b8ff4f90349625
tree71d6298db81733d652abaa510c09ba90078efff0
parent8bcfd31cc01e068bca78aa42a87c24aea6ebc6b1
bpo-40453: Add PyConfig._isolated_subinterpreter (GH-19820)

An isolated subinterpreter cannot spawn threads, spawn a child
process or call os.fork().

* Add private _Py_NewInterpreter(isolated_subinterpreter) function.
* Add isolated=True keyword-only parameter to
  _xxsubinterpreters.create().
* Allow again os.fork() in "non-isolated" subinterpreters.
14 files changed:
Doc/c-api/init_config.rst
Include/cpython/initconfig.h
Include/cpython/pylifecycle.h
Lib/test/test__xxsubinterpreters.py
Lib/test/test_embed.py
Misc/NEWS.d/next/Library/2020-04-30-22-04-58.bpo-40453.ggz7sl.rst [new file with mode: 0644]
Modules/_posixsubprocess.c
Modules/_threadmodule.c
Modules/_winapi.c
Modules/_xxsubinterpretersmodule.c
Modules/posixmodule.c
Programs/_testembed.c
Python/initconfig.c
Python/pylifecycle.c