diff --git a/python/servo/command_base.py b/python/servo/command_base.py index ce8c1ddb237..43d2e97d89c 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -141,7 +141,7 @@ def call(*args, **kwargs): return subprocess.call(*args, shell=sys.platform == 'win32', **kwargs) -def check_output(*args, **kwargs): +def check_output(*args, **kwargs) -> bytes: """Wrap `subprocess.call`, printing the command if verbose=True.""" verbose = kwargs.pop('verbose', False) if verbose: @@ -980,10 +980,10 @@ class CommandBase(object): servo.platform.get().passive_bootstrap() - needs_toolchain_install = self.cross_compile_target \ - and self.cross_compile_target not in check_output( - ["rustup", "target", "list", "--installed"], cwd=self.context.topdir - ) + needs_toolchain_install = self.cross_compile_target and \ + self.cross_compile_target not in \ + check_output(["rustup", "target", "list", "--installed"], + cwd=self.context.topdir).decode() if needs_toolchain_install: check_call(["rustup", "target", "add", self.cross_compile_target], cwd=self.context.topdir) diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index a9944775dda..78a9e2f6644 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -245,7 +245,9 @@ class PostBuildCommands(CommandBase): @CommandBase.build_like_command_arguments def doc(self, params: List[str], **kwargs): self.ensure_bootstrapped() - rustc_path = check_output(["rustup" + BIN_SUFFIX, "which", "rustc"], cwd=self.context.topdir) + rustc_path = check_output( + ["rustup" + BIN_SUFFIX, "which", "rustc"], + cwd=self.context.topdir).decode("utf-8") assert path.basename(path.dirname(rustc_path)) == "bin" toolchain_path = path.dirname(path.dirname(rustc_path)) rust_docs = path.join(toolchain_path, "share", "doc", "rust", "html")