version.py: do not use sys.argv in a sub-function

Even more when this sub-function is used in another module (setup.py in this
case).

Reported-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Rémi Duraffort <remi.duraffort@linaro.org>
15 jobs for <span class="ref-name">version-script</span> in 14 minutes and 26 seconds (queued for 4 seconds)
Status Job ID Name Coverage
  Test
passed #48412
amd64
dispatcher-debian-10

00:03:48

passed #48410
amd64
dispatcher-debian-9

00:04:50

passed #48413
amd64
server-debian-10

00:06:08

passed #48411
amd64
server-debian-9

00:03:04

 
  Analyze
passed #48415
amd64
black

00:00:53

passed #48417
amd64
code_quality

00:00:31

passed #48416
amd64
codestyle

00:00:49

passed #48419
amd64
job-schema

00:01:44

passed #48418
amd64
pylint

00:02:30

passed #48414
amd64-dind allowed to fail
sast

00:02:30

 
  Build
passed #48422
amd64
amd64/pkg-debian-10

00:01:32

passed #48421
amd64
amd64/pkg-debian-9

00:02:11

passed #48420
amd64
doc

00:02:08

 
  Docker
passed #48423
amd64-dind
amd64/lava-dispatcher

00:02:02

passed #48424
amd64-dind
amd64/lava-server

00:02:54