From 1dbb73b5a33368bf295ddc409256189903732974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20S=C5=82awecki?= Date: Thu, 11 Dec 2025 18:02:26 +0100 Subject: [PATCH] Fix os.posix_spawn() error handling (GH-142532) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consistently use `goto exit;` in `py_posix_spawn()`. (cherry picked from commit 8cfa351560487d472df4c7d841814801fbf57397) Co-authored-by: Bartosz Sławecki --- Modules/posixmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 2370ac19c1dd42..e50a14dcb7b1f4 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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) {