Commit 39bb5680 authored by Raul Tambre's avatar Raul Tambre Committed by Commit Bot

mojo: Fix generating salt in Python 3

Works on both Python 2 and 3.
There should be no behavioural changes.

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 267, in _Generate
    processor._GenerateModule(args, remaining_args, generator_modules,
  File "../../mojo/public/tools/bindings/mojom_bindings_generator.py", line 210, in _GenerateModule
    salt = ''.join(
TypeError: sequence item 0: expected str instance, bytes found

Bug: 941669
Change-Id: Ie77d9fd53f9f0077f07bbbe6e22ed2a565d2c3f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1995398
Auto-Submit: Raul Tambre <raul@tambre.ee>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Raul Tambre <raul@tambre.ee>
Cr-Commit-Position: refs/heads/master@{#732356}
parent 99e2ba82
......@@ -207,7 +207,7 @@ class MojomProcessor(object):
module = translate.OrderedModule(tree, module_path, imports)
if args.scrambled_message_id_salt_paths:
salt = ''.join(
salt = b''.join(
map(ReadFileContents, args.scrambled_message_id_salt_paths))
ScrambleMethodOrdinals(module.interfaces, salt)
......
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