From a920a17b2f418535870788ae81234dc6b8aa6661 Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Tue, 27 Sep 2016 16:03:50 +0100 Subject: patman: Make print statements python 3.x safe In python 3.x, print must be used as a function call. Convert all print statements to the function call style, importing from __future__ where we print with no trailing newline or print to a file object. Signed-off-by: Paul Burton Acked-by: Simon Glass --- tools/patman/patman.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tools/patman/patman.py') diff --git a/tools/patman/patman.py b/tools/patman/patman.py index fe50eb4d5c8..fdbee67f559 100755 --- a/tools/patman/patman.py +++ b/tools/patman/patman.py @@ -93,11 +93,11 @@ elif options.test: suite.run(result) # TODO: Surely we can just 'print' result? - print result + print(result) for test, err in result.errors: - print err + print(err) for test, err in result.failures: - print err + print(err) # Called from git with a patch filename as argument # Printout a list of additional CC recipients for this patch @@ -110,7 +110,7 @@ elif options.cc_cmd: for cc in match.group(2).split(', '): cc = cc.strip() if cc: - print cc + print(cc) fd.close() elif options.full_help: @@ -166,12 +166,12 @@ else: options.dry_run, not options.ignore_bad_tags, cc_file, in_reply_to=options.in_reply_to, thread=options.thread) else: - print col.Color(col.RED, "Not sending emails due to errors/warnings") + print(col.Color(col.RED, "Not sending emails due to errors/warnings")) # For a dry run, just show our actions as a sanity check if options.dry_run: series.ShowActions(args, cmd, options.process_tags) if not its_a_go: - print col.Color(col.RED, "Email would not be sent") + print(col.Color(col.RED, "Email would not be sent")) os.remove(cc_file) -- cgit v1.2.3