From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- dom/bindings/mozwebidlcodegen/__init__.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'dom/bindings/mozwebidlcodegen') diff --git a/dom/bindings/mozwebidlcodegen/__init__.py b/dom/bindings/mozwebidlcodegen/__init__.py index 8b6e62f345..3e8c6aa420 100644 --- a/dom/bindings/mozwebidlcodegen/__init__.py +++ b/dom/bindings/mozwebidlcodegen/__init__.py @@ -14,7 +14,6 @@ import os from copy import deepcopy import mozpack.path as mozpath -import six from mach.mixin.logging import LoggingMixin from mozbuild.makeutil import Makefile from mozbuild.pythonutil import iter_modules_in_path @@ -339,10 +338,8 @@ class WebIDLCodegenManager(LoggingMixin): if self._make_deps_path: mk = Makefile() codegen_rule = mk.create_rule([self._make_deps_target]) - codegen_rule.add_dependencies( - six.ensure_text(s) for s in global_hashes.keys() - ) - codegen_rule.add_dependencies(six.ensure_text(p) for p in self._input_paths) + codegen_rule.add_dependencies(global_hashes.keys()) + codegen_rule.add_dependencies(self._input_paths) with FileAvoidWrite(self._make_deps_path) as fh: mk.dump(fh) @@ -359,7 +356,12 @@ class WebIDLCodegenManager(LoggingMixin): example_paths = self._example_paths(interface) for path in example_paths: - print("Generating {}".format(path)) + self.log( + logging.INFO, + "webidl_generate_example_files", + {"filename": path}, + "Generating WebIDL example files derived from {filename}", + ) return self._maybe_write_codegen(root, *example_paths) @@ -380,7 +382,7 @@ class WebIDLCodegenManager(LoggingMixin): for path in sorted(self._input_paths): with io.open(path, "r", encoding="utf-8") as fh: data = fh.read() - hashes[path] = hashlib.sha1(six.ensure_binary(data)).hexdigest() + hashes[path] = hashlib.sha1(data.encode()).hexdigest() parser.parse(data, path) # Only these directories may contain WebIDL files with interfaces @@ -494,7 +496,7 @@ class WebIDLCodegenManager(LoggingMixin): for name in changedDictionaryNames: d = self._config.getDictionaryIfExists(name) if d: - changed_inputs.add(d.filename()) + changed_inputs.add(d.filename) # Only use paths that are known to our current state. # This filters out files that were deleted or changed type (e.g. from -- cgit v1.2.3