diff options
author | Mike Frysinger <vapier@google.com> | 2020-04-16 12:38:04 -0400 |
---|---|---|
committer | David Pursehouse <dpursehouse@digital.ai> | 2020-04-28 02:54:50 +0000 |
commit | dd37fb22227f2abfb4b4f657dded42d422ac2e9c (patch) | |
tree | 0d1b74afbe98d1da948c6b8f5a22c80c52996836 /main.py | |
parent | af908cb5438ec3c03a9a32d1a9f286aa5657ff88 (diff) | |
download | git-repo-dd37fb22227f2abfb4b4f657dded42d422ac2e9c.tar.gz |
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>
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -614,7 +614,7 @@ def _Main(argv): | |||
614 | argv = list(sys.argv) | 614 | argv = list(sys.argv) |
615 | argv.extend(rce.extra_args) | 615 | argv.extend(rce.extra_args) |
616 | try: | 616 | try: |
617 | os.execv(__file__, argv) | 617 | os.execv(sys.executable, [__file__] + argv) |
618 | except OSError as e: | 618 | except OSError as e: |
619 | print('fatal: cannot restart repo after upgrade', file=sys.stderr) | 619 | print('fatal: cannot restart repo after upgrade', file=sys.stderr) |
620 | print('fatal: %s' % e, file=sys.stderr) | 620 | print('fatal: %s' % e, file=sys.stderr) |