Update write_cargo_toml.py to python3
Update the script to use python3, and update the print
statements to use python3 style.
Bug: 80434
Change-Id: If68b735ac16e1e6604e58c5313c98c5a22487e2d
Reviewed-on: https://fuchsia-review.googlesource.com/c/cobalt/+/553418
Fuchsia-Auto-Submit: Steve Fung <stevefung@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Reviewed-by: Zach Bush <zmbush@google.com>
diff --git a/build/rust/write_cargo_toml.py b/build/rust/write_cargo_toml.py
index e38c77e..12f7ecb 100755
--- a/build/rust/write_cargo_toml.py
+++ b/build/rust/write_cargo_toml.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2018 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.
@@ -57,10 +57,10 @@
# or `None` on failure.
def add_dep(args, third_party_json, data_path):
if not os.path.isfile(data_path):
- print TERM_COLOR_RED
- print "Missing Rust target data for dependency " + data_path
- print "Did you accidentally depend on a non-Rust target?"
- print TERM_COLOR_END
+ print(TERM_COLOR_RED)
+ print("Missing Rust target data for dependency " + data_path)
+ print("Did you accidentally depend on a non-Rust target?")
+ print(TERM_COLOR_END)
return None
dep_data = json.load(open(data_path))
if dep_data["third_party"]: