Convert print statements to Python 3 style
Ran "2to3 -w -n -f print ./" and manually added imports.
Ran "^\s*print " and "\s+print " to find batch/shell scripts, comments and the like with embedded code, and updated them manually.
Also manually added imports to files, which used print as a function, but were missing the import.
The scripts still work with Python 2.
There are no intended behaviour changes.
Bug: 942522
Change-Id: Id777e4d4df4adcdfdab1b18bde89f235ef491b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595684
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
diff --git a/gclient.py b/gclient.py
index fd65470..ad31662 100755
--- a/gclient.py
+++ b/gclient.py
@@ -1650,12 +1650,11 @@
# clean checkout.
gclient_scm.scm.GIT.CleanupDir(par_scm_root, rel_e_dir)
assert not os.path.exists(os.path.join(e_dir, '.git'))
- print(('\nWARNING: \'%s\' has been moved from DEPS to a higher '
- 'level checkout. The git folder containing all the local'
- ' branches has been saved to %s.\n'
- 'If you don\'t care about its state you can safely '
- 'remove that folder to free up space.') %
- (entry, save_dir))
+ print('\nWARNING: \'%s\' has been moved from DEPS to a higher '
+ 'level checkout. The git folder containing all the local'
+ ' branches has been saved to %s.\n'
+ 'If you don\'t care about its state you can safely '
+ 'remove that folder to free up space.' % (entry, save_dir))
continue
if scm_root in full_entries:
@@ -1684,9 +1683,9 @@
should_recurse=False,
relative=None,
condition=None))
- print(('\nWARNING: \'%s\' is no longer part of this client.\n'
- 'It is recommended that you manually remove it or use '
- '\'gclient sync -D\' next time.') % entry_fixed)
+ print('\nWARNING: \'%s\' is no longer part of this client.\n'
+ 'It is recommended that you manually remove it or use '
+ '\'gclient sync -D\' next time.' % entry_fixed)
else:
# Delete the entry
print('\n________ deleting \'%s\' in \'%s\'' % (