west: main: fix incorrect use of sys.argv

The argument array to main is in the argv argument, *not* sys.argv.
Fix this.

(Using sys.argv directly prevents the main function from getting its
arguments from an arbitrary value specified by the caller.)

Signed-off-by: Marti Bolivar <marti@foundries.io>
This commit is contained in:
Marti Bolivar 2018-12-17 16:47:49 -07:00 committed by Carles Cufí
parent b1959be7d3
commit 2cff25e88c
1 changed files with 1 additions and 1 deletions

View File

@ -219,7 +219,7 @@ def main(argv=None):
except WestUpdated: except WestUpdated:
# West has been automatically updated. Restart ourselves to run the # West has been automatically updated. Restart ourselves to run the
# latest version, with the same arguments that we were given. # latest version, with the same arguments that we were given.
os.execv(sys.executable, [sys.executable] + sys.argv) os.execv(sys.executable, [sys.executable] + argv)
except KeyboardInterrupt: except KeyboardInterrupt:
sys.exit(0) sys.exit(0)
except CalledProcessError as cpe: except CalledProcessError as cpe: