[ycm] Fix python script

This fixes the youcompleteme config script to look for ninja_output.py
in tools/vim instead of tools/ninja (it was moved there in
https://crrev.com/c/2797536), and makes a minor adjustment for python3
compatibility.

R=machenbach@chromium.org

Bug: v8:11879
Change-Id: Ia825903fb6019865244c5529bf2d23935a10ad5e
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3059077
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75984}
This commit is contained in:
Clemens Backes 2021-07-28 18:46:28 +02:00 committed by V8 LUCI CQ
parent 2049e188c6
commit 02ba58d59d

View File

@ -114,7 +114,7 @@ def GetClangCommandFromNinjaForFilename(v8_root, filename):
# should contain most/all of the interesting flags for other targets too.
filename = os.path.join(v8_root, 'src', 'utils', 'utils.cc')
sys.path.append(os.path.join(v8_root, 'tools', 'ninja'))
sys.path.append(os.path.join(v8_root, 'tools', 'vim'))
from ninja_output import GetNinjaOutputDirectory
out_dir = os.path.realpath(GetNinjaOutputDirectory(v8_root))
@ -133,7 +133,7 @@ def GetClangCommandFromNinjaForFilename(v8_root, filename):
# Ninja might execute several commands to build something. We want the last
# clang command.
clang_line = None
for line in reversed(stdout.split('\n')):
for line in reversed(stdout.decode('utf-8').splitlines()):
if 'clang' in line:
clang_line = line
break