@@ -7611,7 +7611,7 @@ parse_posix_spawn_flags(PyObject *module, const char *func_name, PyObject *setpg
76117611 PyObject *setsigdef, PyObject *scheduler,
76127612 posix_spawnattr_t *attrp)
76137613{
7614- assert(scheduler == NULL || PyTuple_Check(scheduler));
7614+ assert(scheduler == NULL || scheduler == Py_None || PyTuple_Check(scheduler));
76157615 long all_flags = 0;
76167616
76177617 errno = posix_spawnattr_init(attrp);
@@ -7620,7 +7620,7 @@ parse_posix_spawn_flags(PyObject *module, const char *func_name, PyObject *setpg
76207620 return -1;
76217621 }
76227622
7623- if (setpgroup) {
7623+ if (setpgroup && setpgroup != Py_None ) {
76247624 pid_t pgid = PyLong_AsPid(setpgroup);
76257625 if (pgid == (pid_t)-1 && PyErr_Occurred()) {
76267626 goto fail;
@@ -7918,7 +7918,7 @@ py_posix_spawn(int use_posix_spawnp, PyObject *module, path_t *path, PyObject *a
79187918 goto exit;
79197919 }
79207920
7921- if (!PyTuple_Check(scheduler) && scheduler != Py_None) {
7921+ if (scheduler && !PyTuple_Check(scheduler) && scheduler != Py_None) {
79227922 PyErr_Format(PyExc_TypeError,
79237923 "%s: scheduler must be a tuple or None", func_name);
79247924 goto exit;
@@ -8035,7 +8035,7 @@ os.posix_spawn
80358035 *
80368036 file_actions: object(c_default='NULL') = ()
80378037 A sequence of file action tuples.
8038- setpgroup: object = NULL
8038+ setpgroup: object(c_default='NULL') = None
80398039 The pgroup to use with the POSIX_SPAWN_SETPGROUP flag.
80408040 resetids: bool = False
80418041 If the value is `true` the POSIX_SPAWN_RESETIDS will be activated.
@@ -8057,7 +8057,7 @@ os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
80578057 PyObject *setpgroup, int resetids, int setsid,
80588058 PyObject *setsigmask, PyObject *setsigdef,
80598059 PyObject *scheduler)
8060- /*[clinic end generated code: output=14a1098c566bc675 input=242939f993243c45 ]*/
8060+ /*[clinic end generated code: output=14a1098c566bc675 input=69e7c9ebbdcf94a5 ]*/
80618061{
80628062 return py_posix_spawn(0, module, path, argv, env, file_actions,
80638063 setpgroup, resetids, setsid, setsigmask, setsigdef,
@@ -8081,7 +8081,7 @@ os.posix_spawnp
80818081 *
80828082 file_actions: object(c_default='NULL') = ()
80838083 A sequence of file action tuples.
8084- setpgroup: object = NULL
8084+ setpgroup: object(c_default='NULL') = None
80858085 The pgroup to use with the POSIX_SPAWN_SETPGROUP flag.
80868086 resetids: bool = False
80878087 If the value is `True` the POSIX_SPAWN_RESETIDS will be activated.
@@ -8103,7 +8103,7 @@ os_posix_spawnp_impl(PyObject *module, path_t *path, PyObject *argv,
81038103 PyObject *setpgroup, int resetids, int setsid,
81048104 PyObject *setsigmask, PyObject *setsigdef,
81058105 PyObject *scheduler)
8106- /*[clinic end generated code: output=7b9aaefe3031238d input=e77db185549d088c ]*/
8106+ /*[clinic end generated code: output=7b9aaefe3031238d input=a5c057527c6881a5 ]*/
81078107{
81088108 return py_posix_spawn(1, module, path, argv, env, file_actions,
81098109 setpgroup, resetids, setsid, setsigmask, setsigdef,
0 commit comments