Skip to content

Commit

Permalink
Make the ninja_output.py work on python3 too.
Browse files Browse the repository at this point in the history
This is the only required step so YCM works on vim with python3.

Review-Url: https://codereview.chromium.org/2704093004
Cr-Commit-Position: refs/heads/master@{#451923}
  • Loading branch information
emilio authored and Commit bot committed Feb 22, 2017
1 parent 12d9a31 commit 8aaeb7f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tools/vim/ninja_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@

import sys
import os
import exceptions
import itertools
import re

try:
from exceptions import RuntimeError
except ImportError:
pass

def GetNinjaOutputDirectory(chrome_root):
"""Returns <chrome_root>/<output_dir>/(Release|Debug|<other>).
Expand Down Expand Up @@ -62,10 +65,10 @@ def safe_mtime(path):
try:
return max(generate_paths(), key=approx_directory_mtime)
except ValueError:
raise exceptions.RuntimeError(
raise RuntimeError(
'Unable to find a valid ninja output directory.')

if __name__ == '__main__':
if len(sys.argv) != 2:
raise exceptions.RuntimeError('Expected a single path argument.')
print GetNinjaOutputDirectory(sys.argv[1])
raise RuntimeError('Expected a single path argument.')
print(GetNinjaOutputDirectory(sys.argv[1]))

0 comments on commit 8aaeb7f

Please sign in to comment.