mojo: Don't open concatenation files as binary
In Python 3 operations on files opened in binary mode have to be done with bytestrings. Python 2 doesn't care, so it happens to work. Don't open the files in binary mode, as they aren't used as such. Traceback (most recent call last): File "../../mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py", line 73, in <module> main() File "../../mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py", line 70, in main exit(0 if ConcatenateAndReplaceExports(args) else 1) File "../../mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py", line 58, in ConcatenateAndReplaceExports FilterLine(filename, line, target) File "../../mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py", line 30, in FilterLine if line.startswith("goog.require"): TypeError: startswith first arg must be bytes or a tuple of bytes, not str Bug: 941669 Change-Id: Ic373069e87707eb28ca1b3bf60556f066c19c5d1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2081413 Auto-Submit: Raul Tambre <raul@tambre.ee> Commit-Queue: Ken Rockot <rockot@google.com> Reviewed-by:Ken Rockot <rockot@google.com> Cr-Commit-Position: refs/heads/master@{#746169}
Showing
Please register or sign in to comment