]> granicus.if.org Git - python/commitdiff
bpo-30602: Fix lastarg in os.spawnve() (#2287) (#2357)
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 23 Jun 2017 13:21:24 +0000 (15:21 +0200)
committerGitHub <noreply@github.com>
Fri, 23 Jun 2017 13:21:24 +0000 (15:21 +0200)
Fix a regression introduced by myself in the commit
526b22657cb18fe79118c2ea68511aca09430c2c.
(cherry picked from commit c8d6ab2e25ff212702d387e516e258b1d8c52910)

Modules/posixmodule.c

index 0a9123b61bdc06a531e1b13024c70da27680069a..11aaeef02bc50c6e7d491d801577274cdd028be0 100644 (file)
@@ -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");