diff --git a/runtime/tools/compiler_layering_check.py b/runtime/tools/compiler_layering_check.py index 06d73d98fd3..e8c955a0ee0 100755 --- a/runtime/tools/compiler_layering_check.py +++ b/runtime/tools/compiler_layering_check.py @@ -10,7 +10,6 @@ # Currently it only checks that core runtime headers RUNTIME_LAYER_HEADERS # are not included into any sources listed in SHOULD_NOT_DEPEND_ON_RUNTIME. -import glob import os import re import sys @@ -107,7 +106,7 @@ class LayeringChecker(object): def ExtractIncludes(self, file): """Extract the list of includes from the given file.""" deps = set() - with open(os.path.join(self.root, file)) as file: + with open(os.path.join(self.root, file), encoding='utf-8') as file: for line in file: if line.startswith('namespace dart {'): break diff --git a/runtime/tools/embedder_layering_check.py b/runtime/tools/embedder_layering_check.py index 775040e5987..5e564d16cad 100644 --- a/runtime/tools/embedder_layering_check.py +++ b/runtime/tools/embedder_layering_check.py @@ -7,7 +7,6 @@ # Simple tool for verifying that sources from the standalone embedder do not # directly include sources from the VM or vice versa. -import glob import os import re import sys @@ -28,7 +27,7 @@ EXTRA_TEST_FILES = [ def CheckFile(sdk_root, path): includes = set() - with open(os.path.join(sdk_root, path)) as file: + with open(os.path.join(sdk_root, path), encoding='utf-8') as file: for line in file: m = INCLUDE_DIRECTIVE_RE.match(line) if m is not None: