releasetools: Replace print stmt with print().
So that it's compatible with Python 3.
Test: pylint --pylint=pylintrc
Change-Id: If06c135a492c94bedd713c8cbdf03155a502d5cd
diff --git a/tools/releasetools/img_from_target_files.py b/tools/releasetools/img_from_target_files.py
index 84e0e63..fd98ad2 100755
--- a/tools/releasetools/img_from_target_files.py
+++ b/tools/releasetools/img_from_target_files.py
@@ -26,10 +26,12 @@
"""
+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 @@
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 @@
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 @@
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)