diff options
author | mark a. foltz <mfoltz@chromium.org> | 2021-08-19 17:10:11 -0700 |
---|---|---|
committer | Openscreen LUCI CQ <openscreen-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2021-08-23 19:15:21 +0000 |
commit | 8f61e5d17d581c029fb5f827a0bc5e1d2bb3acec (patch) | |
tree | 2c1499213663479ae6af0eec5f98d93336353a07 | |
parent | 13b515f3c0f9992e9041e3b67261d95d573ef0ad (diff) | |
download | openscreen-8f61e5d17d581c029fb5f827a0bc5e1d2bb3acec.tar.gz |
[Open Screen] Update scripts to python3.
This migrates Open Screen scripts to use python3.
python2 is being removed from gLinux soon.
Bug: b/195416694
Change-Id: Ib3ab4cb3d6d0e8129e6b3ee06dd31b339b014358
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/3069195
Reviewed-by: Ryan Keane <rwkeane@google.com>
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
-rw-r--r-- | .gn | 1 | ||||
-rw-r--r-- | build/code_coverage/merge_lib.py | 3 | ||||
-rw-r--r-- | build/code_coverage/merge_results.py | 2 | ||||
-rw-r--r-- | build/code_coverage/merge_steps.py | 2 | ||||
-rwxr-xr-x | build/scripts/dir_exists.py | 2 | ||||
-rwxr-xr-x | build/scripts/install-sysroot.py | 9 | ||||
-rwxr-xr-x | build/scripts/sysroot_ld_path.py | 2 | ||||
-rwxr-xr-x | testing/libfuzzer/archive_corpus.py | 2 | ||||
-rwxr-xr-x | testing/libfuzzer/gen_fuzzer_config.py | 6 | ||||
-rw-r--r-- | tools/cddl/cddl.py | 2 | ||||
-rwxr-xr-x | tools/convert_to_data_file.py | 2 | ||||
-rwxr-xr-x | tools/curlish.py | 2 | ||||
-rwxr-xr-x | tools/download-clang-update-script.py | 2 | ||||
-rwxr-xr-x | tools/download-yajsv.py | 2 |
14 files changed, 21 insertions, 18 deletions
@@ -1,2 +1,3 @@ # The location of the build configuration file. buildconfig = "//build/config/BUILDCONFIG.gn" +script_executable = "python3" diff --git a/build/code_coverage/merge_lib.py b/build/code_coverage/merge_lib.py index 4b956d06..ec951dc1 100644 --- a/build/code_coverage/merge_lib.py +++ b/build/code_coverage/merge_lib.py @@ -1,4 +1,4 @@ -#!/usr/bin/env/python +#!/usr/bin/env python3 # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -325,4 +325,3 @@ def get_shards_to_retry(bad_profiles): assert is_task_id(task_id) bad_shard_ids.add(task_id) return bad_shard_ids - diff --git a/build/code_coverage/merge_results.py b/build/code_coverage/merge_results.py index 67e63365..40bf7ca3 100644 --- a/build/code_coverage/merge_results.py +++ b/build/code_coverage/merge_results.py @@ -1,4 +1,4 @@ -#!/usr/bin/env/python +#!/usr/bin/env python3 # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/build/code_coverage/merge_steps.py b/build/code_coverage/merge_steps.py index f1140938..af876af9 100644 --- a/build/code_coverage/merge_steps.py +++ b/build/code_coverage/merge_steps.py @@ -1,4 +1,4 @@ -#!/usr/bin/env/python +#!/usr/bin/env python3 # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/build/scripts/dir_exists.py b/build/scripts/dir_exists.py index 1e633d22..16400f58 100755 --- a/build/scripts/dir_exists.py +++ b/build/scripts/dir_exists.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/build/scripts/install-sysroot.py b/build/scripts/install-sysroot.py index 374598f1..898cc7ce 100755 --- a/build/scripts/install-sysroot.py +++ b/build/scripts/install-sysroot.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -65,8 +65,8 @@ def GetSha1(filename): def GetSysrootDict(target_platform, target_arch): - """Gets the sysroot information for a given platform and arch from the sysroots.json - file.""" + """Gets the sysroot information for a given platform and arch from the + sysroots.json file.""" if target_arch not in VALID_ARCHS: raise Error('Unknown architecture: %s' % target_arch) @@ -92,7 +92,8 @@ def DownloadFile(url, local_path): raise Error('Failed to download %s' % url) def ValidateFile(local_path, expected_sum): - """Generates the SHA1 hash of a local file to compare with an expected hashsum.""" + """Generates the SHA1 hash of a local file to compare with an expected + hashsum.""" sha1sum = GetSha1(local_path) if sha1sum != expected_sum: raise Error('Tarball sha1sum is wrong.' diff --git a/build/scripts/sysroot_ld_path.py b/build/scripts/sysroot_ld_path.py index 85873812..4502f258 100755 --- a/build/scripts/sysroot_ld_path.py +++ b/build/scripts/sysroot_ld_path.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/testing/libfuzzer/archive_corpus.py b/testing/libfuzzer/archive_corpus.py index e80848dd..e1960854 100755 --- a/testing/libfuzzer/archive_corpus.py +++ b/testing/libfuzzer/archive_corpus.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/testing/libfuzzer/gen_fuzzer_config.py b/testing/libfuzzer/gen_fuzzer_config.py index bde9e146..d195b5a1 100755 --- a/testing/libfuzzer/gen_fuzzer_config.py +++ b/testing/libfuzzer/gen_fuzzer_config.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python3 # # Copyright (c) 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -8,8 +8,8 @@ Invoked by GN from fuzzer_test.gni. """ -import ConfigParser import argparse +import configparser import os import sys @@ -52,7 +52,7 @@ def main(): args.asan_options or args.msan_options or args.ubsan_options): return - config = ConfigParser.ConfigParser() + config = configparser.ConfigParser() libfuzzer_options = [] if args.dict: libfuzzer_options.append(('dict', os.path.basename(args.dict))) diff --git a/tools/cddl/cddl.py b/tools/cddl/cddl.py index 28436f27..8625a9ae 100644 --- a/tools/cddl/cddl.py +++ b/tools/cddl/cddl.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + # Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/tools/convert_to_data_file.py b/tools/convert_to_data_file.py index 05456f08..c6af0da8 100755 --- a/tools/convert_to_data_file.py +++ b/tools/convert_to_data_file.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/tools/curlish.py b/tools/curlish.py index c0324b02..956c5c43 100755 --- a/tools/curlish.py +++ b/tools/curlish.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/tools/download-clang-update-script.py b/tools/download-clang-update-script.py index b8b67a69..203862ec 100755 --- a/tools/download-clang-update-script.py +++ b/tools/download-clang-update-script.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/tools/download-yajsv.py b/tools/download-yajsv.py index d42d3f3a..b127b1ff 100755 --- a/tools/download-yajsv.py +++ b/tools/download-yajsv.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. |