mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-37951: Lift subprocess's fork() restriction (GH-15544)
This commit is contained in:
parent
3224e1a6bb
commit
98d90f745d
4 changed files with 19 additions and 2 deletions
|
@ -583,8 +583,10 @@ subprocess_fork_exec(PyObject* self, PyObject *args)
|
|||
&restore_signals, &call_setsid, &preexec_fn))
|
||||
return NULL;
|
||||
|
||||
if (_PyInterpreterState_Get() != PyInterpreterState_Main()) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "fork not supported for subinterpreters");
|
||||
if ((preexec_fn != Py_None) &&
|
||||
(_PyInterpreterState_Get() != PyInterpreterState_Main())) {
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"preexec_fn not supported within subinterpreters");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue