diff --git a/bin/linja.in b/bin/linja.in index 9d805e578..51e8b288f 100755 --- a/bin/linja.in +++ b/bin/linja.in @@ -516,6 +516,10 @@ def call_ninja(args): ninja_option += ["-k", args.keep_going] proc = subprocess.Popen([g_ninja_path] + ninja_option + targets, stdout=proc_out, stderr=proc_err) (out, err) = proc.communicate() + if out: + out = out.decode('utf-8') + if err: + err = err.decode('utf-8') if args.flycheck: if len(args.targets) == 1 and (args.targets[0].endswith(".lean") or args.targets[0].endswith(".hlean")): process_lean_output(targets[0], out, args, args.targets[0].endswith(".hlean")) @@ -528,7 +532,7 @@ def call_ninja(args): def call_lean(filename, args): proc = subprocess.Popen([g_lean_path] + args.lean_options + [filename], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - out = proc.communicate()[0] + out = proc.communicate()[0].decode('utf-8') process_lean_output(filename, out, args, filename.endswith(".hlean")) return proc.returncode @@ -684,13 +688,13 @@ def make_deps(lean_file, dlean_file, olean_file): with open(dlean_file, "w") as f: deps = [] proc = subprocess.Popen([g_lean_path, "--deps", lean_file], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - output = proc.communicate()[0] + output = proc.communicate()[0].decode('utf-8') print(escape_dep(olean_file) + ": \\", file=f) for olean_file in output.strip().splitlines(): if olean_file: deps.append(normalize_drive_name(os.path.abspath(olean_file))) deps = list(map(escape_dep, deps)) - deps_str = b" " + (b" \\\n ".join(deps)) + deps_str = " " + (" \\\n ".join(deps)) print(deps_str, file=f) def make_deps_all_files(args):