]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] Fix os.posix_spawn() error handling (GH-142532) (#142581)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 17 Dec 2025 15:43:51 +0000 (16:43 +0100)
committerGitHub <noreply@github.com>
Wed, 17 Dec 2025 15:43:51 +0000 (15:43 +0000)
Fix os.posix_spawn() error handling (GH-142532)

Consistently use `goto exit;` in `py_posix_spawn()`.
(cherry picked from commit 8cfa351560487d472df4c7d841814801fbf57397)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Modules/posixmodule.c

index 2370ac19c1dd42ec35f90617e1a430866138fb2b..e50a14dcb7b1f4703959fa9263cdef6c0a5c820f 100644 (file)
@@ -7352,7 +7352,7 @@ py_posix_spawn(int use_posix_spawnp, PyObject *module, path_t *path, PyObject *a
     if (argc < 1) {
         PyErr_Format(PyExc_ValueError,
                      "%s: argv must not be empty", func_name);
-        return NULL;
+        goto exit;
     }
 
     if (!PyMapping_Check(env) && env != Py_None) {