mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
main: re-exec self with the current interp
The launcher already raised itself up to use Python 3 on the fly, and the main.py script uses a plain `python` shebang. So make sure we use the active interpreter when re-execing ourselves to avoid falling back down to Python 2 (which then triggers warnings). Change-Id: Ic53c07dead3bc9233e4089a0a422f83bb5ac2f91 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/263272 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@digital.ai>
This commit is contained in:
parent
af908cb543
commit
dd37fb2222
2
main.py
2
main.py
@ -614,7 +614,7 @@ def _Main(argv):
|
||||
argv = list(sys.argv)
|
||||
argv.extend(rce.extra_args)
|
||||
try:
|
||||
os.execv(__file__, argv)
|
||||
os.execv(sys.executable, [__file__] + argv)
|
||||
except OSError as e:
|
||||
print('fatal: cannot restart repo after upgrade', file=sys.stderr)
|
||||
print('fatal: %s' % e, file=sys.stderr)
|
||||
|
Loading…
Reference in New Issue
Block a user