diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2022-10-31 19:35:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-31 19:35:54 (GMT) |
commit | 4702552885811d0af8f0e4545f494336801ad4dd (patch) | |
tree | a8d24ed97f3e4561bf79ce6d27bd46cba2ecb303 /Modules/_winapi.c | |
parent | 3b86538661038ee23d0be80bb7593e2e7856f059 (diff) | |
download | cpython-4702552885811d0af8f0e4545f494336801ad4dd.zip cpython-4702552885811d0af8f0e4545f494336801ad4dd.tar.gz cpython-4702552885811d0af8f0e4545f494336801ad4dd.tar.bz2 |
gh-98610: Adjust the Optional Restrictions on Subinterpreters (GH-98618)
Previously, the optional restrictions on subinterpreters were: disallow fork, subprocess, and threads. By default, we were disallowing all three for "isolated" interpreters. We always allowed all three for the main interpreter and those created through the legacy `Py_NewInterpreter()` API.
Those settings were a bit conservative, so here we've adjusted the optional restrictions to: fork, exec, threads, and daemon threads. The default for "isolated" interpreters disables fork, exec, and daemon threads. Regular threads are allowed by default. We continue always allowing everything For the main interpreter and the legacy API.
In the code, we add `_PyInterpreterConfig.allow_exec` and `_PyInterpreterConfig.allow_daemon_threads`. We also add `Py_RTFLAGS_DAEMON_THREADS` and `Py_RTFLAGS_EXEC`.
Diffstat (limited to 'Modules/_winapi.c')
-rw-r--r-- | Modules/_winapi.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/Modules/_winapi.c b/Modules/_winapi.c index 2a916cc..71e74d1 100644 --- a/Modules/_winapi.c +++ b/Modules/_winapi.c @@ -1089,13 +1089,6 @@ _winapi_CreateProcess_impl(PyObject *module, return NULL; } - PyInterpreterState *interp = PyInterpreterState_Get(); - if (!_PyInterpreterState_HasFeature(interp, Py_RTFLAGS_SUBPROCESS)) { - PyErr_SetString(PyExc_RuntimeError, - "subprocess not supported for isolated subinterpreters"); - return NULL; - } - ZeroMemory(&si, sizeof(si)); si.StartupInfo.cb = sizeof(si); |