mojo: Fix writing bytes to files on Python 3
Avoids having decode()s at callsites. Traceback (most recent call last): File "../../mojo/public/tools/bindings/mojom_bindings_generator.py", line 556, in <module> sys.exit(main()) File "../../mojo/public/tools/bindings/mojom_bindings_generator.py", line 551, in main return args.func(args, remaining_args) File "../../mojo/public/tools/bindings/mojom_bindings_generator.py", line 334, in _Parse _ParseFile(args, RelativePath(filename, args.depth)) File "../../mojo/public/tools/bindings/mojom_bindings_generator.py", line 323, in _ParseFile _PickleAST(tree, _GetPicklePath(rel_filename, args.output_dir)) File "../../mojo/public/tools/bindings/mojom_bindings_generator.py", line 295, in _PickleAST WriteFile(pickle.dumps(ast), output_file) File "C:\Google\chromium\src\mojo\public\tools\bindings\pylib\mojom\generate\generator.py", line 118, in WriteFile f.write(contents.encode('utf-8')) AttributeError: 'bytes' object has no attribute 'encode' Bug: 941669 Change-Id: I116e469dd5ff7903779226b7ea18cdd5e4cc2fe7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2031112 Commit-Queue: Ken Rockot <rockot@google.com> Auto-Submit: Raul Tambre <raul@tambre.ee> Reviewed-by:Ken Rockot <rockot@google.com> Cr-Commit-Position: refs/heads/master@{#738039}
Showing
Please register or sign in to comment