releasetools: Replace print stmt with print().

So that it's compatible with Python 3.

Test: pylint --pylint=pylintrc

Change-Id: If06c135a492c94bedd713c8cbdf03155a502d5cd
This commit is contained in:
Tao Bao
2017-01-10 10:47:58 -08:00
parent 4dbe67cddc
commit 89fbb0f6d5
5 changed files with 109 additions and 105 deletions

View File

@@ -26,10 +26,12 @@ Usage: img_from_target_files [flags] input_target_files output_image_zip
"""
from __future__ import print_function
import sys
if sys.hexversion < 0x02070000:
print >> sys.stderr, "Python 2.7 or newer is required."
print("Python 2.7 or newer is required.", file=sys.stderr)
sys.exit(1)
import os
@@ -111,7 +113,7 @@ def main(argv):
recovery_image.AddToZip(output_zip)
def banner(s):
print "\n\n++++ " + s + " ++++\n\n"
print("\n\n++++ " + s + " ++++\n\n")
if not bootable_only:
banner("AddSystem")
@@ -128,11 +130,11 @@ def main(argv):
add_img_to_target_files.AddCache(output_zip, prefix="")
finally:
print "cleaning up..."
print("cleaning up...")
common.ZipClose(output_zip)
shutil.rmtree(OPTIONS.input_tmp)
print "done."
print("done.")
if __name__ == '__main__':
@@ -140,7 +142,5 @@ if __name__ == '__main__':
common.CloseInheritedPipes()
main(sys.argv[1:])
except common.ExternalError as e:
print
print " ERROR: %s" % (e,)
print
print("\n ERROR: %s\n" % (e,))
sys.exit(1)