tools_webrtc dir converted to py3 + top level PRESUBMIT script
Bug: webrtc:13607
Change-Id: Ib018e43ea977cc24dd71048e68e3343741f7f31b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249083
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Christoffer Jansson <jansson@google.com>
Cr-Commit-Position: refs/heads/main@{#35953}
diff --git a/tools_webrtc/gtest-parallel-wrapper.py b/tools_webrtc/gtest-parallel-wrapper.py
index ae48af3..3b07da4 100755
--- a/tools_webrtc/gtest-parallel-wrapper.py
+++ b/tools_webrtc/gtest-parallel-wrapper.py
@@ -53,7 +53,7 @@
Will be converted into:
- python gtest-parallel \
+ vpython3 gtest-parallel \
--shard_index 0 \
--shard_count 1 \
--output_dir=SOME_OUTPUT_DIR \
@@ -82,8 +82,8 @@
['gtest_parallel_args', 'test_env', 'output_dir', 'test_artifacts_dir'])
-def _CatFiles(file_list, output_file):
- with open(output_file, 'w') as output_file:
+def _CatFiles(file_list, output_file_destination):
+ with open(output_file_destination, 'w') as output_file:
for filename in file_list:
with open(filename) as input_file:
output_file.write(input_file.read())
@@ -100,7 +100,7 @@
return max(result, 1) # Sanitize when using e.g. '0.5x'.
-class ReconstructibleArgumentGroup(object):
+class ReconstructibleArgumentGroup:
"""An argument group that can be converted back into a command line.
This acts like ArgumentParser.add_argument_group, but names of arguments added
@@ -154,7 +154,7 @@
parser.add_argument('--store-test-artifacts', action='store_true')
# No-sandbox is a Chromium-specific flag, ignore it.
- # TODO(oprypin): Remove (bugs.webrtc.org/8115)
+ # TODO(bugs.webrtc.org/8115): Remove workaround when fixed.
parser.add_argument('--no-sandbox',
action='store_true',
help=argparse.SUPPRESS)
@@ -171,7 +171,7 @@
}
args_to_pass = []
for arg in unrecognized_args:
- if any(arg.startswith(k) for k in webrtc_flags_to_change.keys()):
+ if any(arg.startswith(k) for k in list(webrtc_flags_to_change.keys())):
arg_split = arg.split('=')
args_to_pass.append(webrtc_flags_to_change[arg_split[0]] + '=' +
arg_split[1])