Commit bf01c9ff authored by Sean Topping's avatar Sean Topping Committed by Chromium LUCI CQ

[Chromecast] Fixes for "Force Python 3 to be used in build."

Some targets only exercised by Chromecast internal builds were broken by
the following change:

https://chromium-review.googlesource.com/c/chromium/src/+/2515787

Bug: 1169966
Tets: Cast internal CQ

Change-Id: I39957eb7f2b7d813b1f00a03598155e9c729c3f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643698
Commit-Queue: Sean Topping <seantopping@chromium.org>
Auto-Submit: Sean Topping <seantopping@chromium.org>
Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846433}
parent 3fde5fa0
......@@ -5,6 +5,8 @@
"""Ensures that Chromecast developers are notified of locale changes."""
from __future__ import print_function
import argparse
import sys
......@@ -45,13 +47,13 @@ def main():
removed_locales = set(CAST_LOCALES) - set(args.locales)
added_locales = set(args.locales) - set(CAST_LOCALES)
print 'CAST_LOCALES no longer matches the locales list from GN!'
print('CAST_LOCALES no longer matches the locales list from GN!')
if removed_locales:
print 'These locales have been removed: {}'.format(list(removed_locales))
print('These locales have been removed: {}'.format(list(removed_locales)))
if added_locales:
print 'These locales have been added: {}'.format(list(added_locales))
print ('Please update CAST_LOCALES in {file} and add a reviewer from '
'//chromecast/OWNERS to your CL. ').format(file=__file__)
print('These locales have been added: {}'.format(list(added_locales)))
print(('Please update CAST_LOCALES in {file} and add a reviewer from '
'//chromecast/OWNERS to your CL. ').format(file=__file__))
return FAILURE_RETURN_CODE
......
......@@ -65,7 +65,7 @@ def ClangFormat(source, filename):
clang_format_cmd = [GetClangFormatPath(), '--assume-filename=' + filename]
proc = subprocess.Popen(
clang_format_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
stdout_output, stderr_output = proc.communicate(input=source)
stdout_output, stderr_output = proc.communicate(input=source.encode('utf8'))
retcode = proc.wait()
if retcode != 0:
raise CalledProcessError(retcode, 'clang-format error: ' + stderr_output)
......@@ -82,7 +82,7 @@ def WriteIfChanged(contents, filename):
with open(filename) as in_fi:
if in_fi.read() == contents:
return
with open(filename, 'w') as out_fi:
with open(filename, 'wb') as out_fi:
out_fi.write(contents)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment