mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
main: Pass path to python binary as arg0 when restarting repo
Not including it causes flaky behavior in some Chromium builders because Chromium's custom Python build used by vpython relies on argv[0] to find its own internal files. Bug: https://crbug.com/1468522 Change-Id: I5c32ebe71c9b684d6ee50dbd8c3d6fcd51ca309b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/381974 Reviewed-by: Chenlin Fan <fancl@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Tested-by: Gavin Mak <gavinmak@google.com>
This commit is contained in:
parent
f9aacd4087
commit
f1ddaaa553
3
main.py
3
main.py
@ -887,11 +887,10 @@ def _Main(argv):
|
||||
result = KEYBOARD_INTERRUPT_EXIT
|
||||
except RepoChangedException as rce:
|
||||
# If repo changed, re-exec ourselves.
|
||||
#
|
||||
argv = list(sys.argv)
|
||||
argv.extend(rce.extra_args)
|
||||
try:
|
||||
os.execv(sys.executable, [__file__] + argv)
|
||||
os.execv(sys.executable, [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