Convert gendepsfile to python 3
Change-Id: Icb974742341d1df971cbdd3cf3a3f6e3829f61d2
diff --git a/fuchsia/gendepsfile.py b/fuchsia/gendepsfile.py
index d6eca21..99c1e85 100755
--- a/fuchsia/gendepsfile.py
+++ b/fuchsia/gendepsfile.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3.8
# Copyright 2021 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -32,11 +32,11 @@
debug_output_files = [x + ".debug " for x in output_files]
- with open(args.depsfile, "w") as depsfile:
+ with open(args.depsfile, "wb") as depsfile:
for output_file in output_files + debug_output_files:
- depsfile.write(os.path.join(va_install_dir, output_file) + ": ")
- depsfile.write(" ".join(x.replace(' ', '\\ ') for x in file_lines))
- depsfile.write("\n")
+ depsfile.write((os.path.join(va_install_dir, output_file) + ": ").encode("utf-8"))
+ depsfile.write(b" ".join(x.replace(b' ', b'\\ ') for x in file_lines))
+ depsfile.write(b"\n")
return 0