Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: tools/vim/chromium.ycm_extra_conf.py

Issue 2039923002: Fix the .ycm_extra_conf.py and SublimeText documentation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/vim/chromium.ycm_extra_conf.py
diff --git a/tools/vim/chromium.ycm_extra_conf.py b/tools/vim/chromium.ycm_extra_conf.py
index 7e0d12c10e3af4416ba50c6977d9f9451a866c40..e9397ce25420ce40e68f3e21ecb48cd94107a866 100644
--- a/tools/vim/chromium.ycm_extra_conf.py
+++ b/tools/vim/chromium.ycm_extra_conf.py
@@ -162,9 +162,10 @@ def GetNinjaBuildOutputsForSourceFile(out_dir, filename):
rel_filename = os.path.relpath(os.path.realpath(filename), out_dir)
p = subprocess.Popen(['ninja', '-C', out_dir, '-t', 'query', rel_filename],
- stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
+ universal_newlines=True)
stdout, _ = p.communicate()
- if p.returncode:
+ if p.returncode != 0:
return []
# The output looks like:
@@ -196,9 +197,9 @@ def GetClangCommandLineForNinjaOutput(out_dir, build_target):
"""
p = subprocess.Popen(['ninja', '-v', '-C', out_dir,
'-t', 'commands', build_target],
- stdout=subprocess.PIPE)
+ stdout=subprocess.PIPE, universal_newlines=True)
stdout, stderr = p.communicate()
- if p.returncode:
+ if p.returncode != 0:
return None
# Ninja will return multiple build steps for all dependencies up to
@@ -331,7 +332,7 @@ def GetClangOptionsFromNinjaForFilename(chrome_root, filename):
out_dir, GetDefaultSourceFile(chrome_root, filename))
if not clang_line:
- return (additional_flags, [])
+ return additional_flags
return GetClangOptionsFromCommandLine(clang_line, out_dir, additional_flags)

Powered by Google App Engine
This is Rietveld 408576698