summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2019-08-27 21:36:56 (GMT)
committerGitHub <noreply@github.com>2019-08-27 21:36:56 (GMT)
commit98d90f745d35d5d07bffcb46788b50e05eea56c6 (patch)
treeef3fd981f4f82f06e73b014bc742cf7a5acfebd9 /Modules
parent3224e1a6bb23b1b322f5b9424b10ab68c9127dcc (diff)
downloadcpython-98d90f745d35d5d07bffcb46788b50e05eea56c6.zip
cpython-98d90f745d35d5d07bffcb46788b50e05eea56c6.tar.gz
cpython-98d90f745d35d5d07bffcb46788b50e05eea56c6.tar.bz2
bpo-37951: Lift subprocess's fork() restriction (GH-15544)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_posixsubprocess.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 60c8eab..f68d362 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -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;
}