summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-06-23 13:21:24 (GMT)
committerGitHub <noreply@github.com>2017-06-23 13:21:24 (GMT)
commitc472fb6b2744b36c7a0823c20e0d5ac9be3ea623 (patch)
treedf8eed86734facb6a294557acc305160bfeeb798
parentc1d5345679eaa5fccd719b1c130140eecc8ba4c8 (diff)
downloadcpython-c472fb6b2744b36c7a0823c20e0d5ac9be3ea623.zip
cpython-c472fb6b2744b36c7a0823c20e0d5ac9be3ea623.tar.gz
cpython-c472fb6b2744b36c7a0823c20e0d5ac9be3ea623.tar.bz2
bpo-30602: Fix lastarg in os.spawnve() (#2287) (#2357)
Fix a regression introduced by myself in the commit 526b22657cb18fe79118c2ea68511aca09430c2c. (cherry picked from commit c8d6ab2e25ff212702d387e516e258b1d8c52910)
-rw-r--r--Modules/posixmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 0a9123b..11aaeef 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5189,7 +5189,7 @@ os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
goto fail_1;
}
if (i == 0 && !argvlist[0][0]) {
- lastarg = i;
+ lastarg = i + 1;
PyErr_SetString(
PyExc_ValueError,
"spawnv() arg 2 first element cannot be empty");