tools: Use Python 3 style print statements [6/9]
Initial conversion performed using '2to3 -f print .'.
Imports added and duplicate parentheses removed manually.
Manually converted files, comments and inline code that 2to3 missed.
Afterwards ran "git cl format --python" and cherry-picked the formatting changes.
There are no intended behavioural changes.
Bug: 941669
Change-Id: I4a423a71375fd4d8cfc8283dd2703855781ece6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1818519
Commit-Queue: Nico Weber <[email protected]>
Reviewed-by: Brian White <[email protected]>
Reviewed-by: Nico Weber <[email protected]>
Auto-Submit: Raul Tambre <[email protected]>
Cr-Commit-Position: refs/heads/master@{#699709}
diff --git a/tools/remove_duplicate_includes.py b/tools/remove_duplicate_includes.py
index cdf9b0d..f09d8cc 100755
--- a/tools/remove_duplicate_includes.py
+++ b/tools/remove_duplicate_includes.py
@@ -11,6 +11,8 @@
Usage: remove_duplicate_includes.py --dry-run components/foo components/bar
"""
+from __future__ import print_function
+
import argparse
import collections
import logging
@@ -45,8 +47,8 @@
if match:
h_file_path = os.path.join(os.getcwd(), match.group(2))
if h_file_path not in h_path_to_include_set:
- print 'First include did not match to a known .h file, skipping ' + \
- cc_file_name + ', line: ' + match.group(1)
+ print('First include did not match to a known .h file, skipping ' + \
+ cc_file_name + ', line: ' + match.group(1))
return None
return h_path_to_include_set[h_file_path]
@@ -64,10 +66,10 @@
for line in input_lines:
match = INCLUDE_REGEX.search(line)
if match and match.group(2) in include_set:
- print 'Removed ' + match.group(1) + ' from ' + cc_file_name
+ print('Removed ' + match.group(1) + ' from ' + cc_file_name)
lastLineWasOmitted = True
elif lastCopiedLineWasEmpty and lastLineWasOmitted and IsEmpty(line):
- print 'Removed empty line from ' + cc_file_name
+ print('Removed empty line from ' + cc_file_name)
lastLineWasOmitted = True
else:
lastCopiedLineWasEmpty = IsEmpty(line)