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>
This commit is contained in:
Raul Tambre
2019-05-06 22:41:05 +00:00
committed by Commit Bot
parent ad1c8b22e2
commit 80ee78e7fa
60 changed files with 424 additions and 317 deletions

View File

@@ -21,6 +21,8 @@ commit's entire history, this script caches all calculated data inside the git
repo that it operates on in the ref 'refs/number/commits'.
"""
from __future__ import print_function
import binascii
import collections
import logging
@@ -278,7 +280,7 @@ def main(): # pragma: no cover
if not opts.no_cache:
finalize(targets)
print '\n'.join(map(str, map(get_num, targets)))
print('\n'.join(map(str, map(get_num, targets))))
return 0