--- src/3rdparty/chromium/tools/polymer/polymer.py.orig 2020-05-06 14:21:29 UTC +++ src/3rdparty/chromium/tools/polymer/polymer.py @@ -491,8 +491,6 @@ def main(argv): # across platforms. with io.open(os.path.join(out_folder, result[1]), mode='w', encoding='utf-8', newline='\n') as f: for l in result[0]: - if (type(l) != unicode): - l = unicode(l, encoding='utf-8') f.write(l) return --- src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_cpp_generator.py.orig 2020-05-06 10:21:29.000000000 -0400 +++ src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_cpp_generator.py 2020-09-18 15:14:28.107285000 -0400 @@ -208,7 +208,14 @@ class Generator(generator.Generator): def __init__(self, *args, **kwargs): + for x in args: + print("I t=" + str(type(x)) + " v=" + str(x)) super(Generator, self).__init__(*args, **kwargs) + for x in args: + print("I t=" + str(type(x)) + " v=" + str(x)) + if self.module is not None: + print("I structs_t =" + str(type(self.module.structs))) + print("I unions_t =" + str(type(self.module.unions))) def _GetExtraTraitsHeaders(self): extra_headers = set() @@ -253,7 +260,7 @@ for field in kind.fields: AddKind(field.kind) - for kind in self.module.structs + self.module.unions: + for kind in list(self.module.structs) + list(self.module.unions): for field in kind.fields: AddKind(field.kind) @@ -271,9 +278,12 @@ for interface in self.module.interfaces: all_enums.extend(interface.enums) + print("all_enums_t=" + str(type(all_enums))) + print("structs_t =" + str(type(self.module.structs))) + print("unions_t =" + str(type(self.module.unions))) types = set(self._GetFullMojomNameForKind(typename) for typename in - self.module.structs + all_enums + self.module.unions) + list(self.module.structs) + list(all_enums) + list(self.module.unions)) headers = set() for typename, typemap in self.typemap.items(): if typename in types: @@ -286,10 +296,10 @@ When false, the generated headers do not need to include interface_ptr.h and similar. """ - if len(self.module.interfaces) > 0: + if len(list(self.module.interfaces)) > 0: return True return any(map(mojom.ContainsHandlesOrInterfaces, - self.module.structs + self.module.unions)) + list(self.module.structs) + list(self.module.unions))) def _ReferencesAnyNativeType(self): """Returns whether this module uses native types directly or indirectly. @@ -300,7 +310,7 @@ m = self.module # Note that interfaces can contain scoped native types. return any(map(mojom.ContainsNativeTypes, - m.enums + m.structs + m.interfaces)) + list(m.enums) + list(m.structs) + list(m.interfaces))) def _GetDirectlyUsedKinds(self): for struct in self.module.structs + self.module.unions: --- src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_js_generator.py.orig 2020-09-18 15:47:26.521091000 -0400 +++ src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_js_generator.py 2020-09-18 15:48:05.296752000 -0400 @@ -260,8 +260,8 @@ "module": self.module, "mojom_filename": os.path.basename(self.module.path), "mojom_namespace": self.module.mojom_namespace, - "structs": self.module.structs + self._GetStructsFromMethods(), - "unions": self.module.unions, + "structs": list(self.module.structs) + list(self._GetStructsFromMethods()), + "unions": list(self.module.unions), "generate_fuzzing": self.generate_fuzzing, "generate_closure_exports": for_compile, "generate_struct_deserializers": self.js_generate_struct_deserializers, --- src/3rdparty/chromium/mojo/public/tools/bindings/pylib/mojom/generate/generator.py.orig 2020-09-18 15:56:57.902602000 -0400 +++ src/3rdparty/chromium/mojo/public/tools/bindings/pylib/mojom/generate/generator.py 2020-09-18 16:13:16.982174000 -0400 @@ -112,7 +112,10 @@ # Dump the data to disk. with open(full_path, "wb") as f: - f.write(contents) + if isinstance(contents, str): + f.write(contents.encode('utf-8')) + else: + f.write(contents) def AddComputedData(module):