project.py: decode byte output from check_result

When running project.py under Python 3, the output is a byte sequence, and
the bazel location gets written to the .bazel_path file as:

  bazel=b'/usr/local/bin/bazel'

This causes launching the project in Eclipse to fail.

To prevent this, decode the byte sequence back to a string.

Change-Id: Ia0e1c7f1e4f934e245dc85d83a01089034679024
This commit is contained in:
David Pursehouse
2018-03-08 08:43:02 +09:00
parent 03b8b2caad
commit ffb6e8ca6e

View File

@@ -57,7 +57,7 @@ def retrieve_ext_location():
return check_output(['bazel', 'info', 'output_base']).strip()
def gen_bazel_path():
bazel = check_output(['which', 'bazel']).strip()
bazel = check_output(['which', 'bazel']).strip().decode('UTF-8')
with open(path.join(ROOT, ".bazel_path"), 'w') as fd:
fd.write("bazel=%s\n" % bazel)
fd.write("PATH=%s\n" % environ["PATH"])