summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2018-03-09 14:06:21 +0000
committerAndrew Bartlett <abartlet@samba.org>2018-03-23 07:28:24 +0100
commit2a64f77d4f72e1c92562f7fa262cc2a4db413536 (patch)
tree6683878c5a5a3b1655229e764930cb4dbeab9a90 /script
parent220f19fce045a80d8c031b684b1edf8c2e33a445 (diff)
downloadsamba-2a64f77d4f72e1c92562f7fa262cc2a4db413536.tar.gz
script: convert print func to be py2/py3 compatible
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'script')
-rwxr-xr-xscript/autobuild.py13
-rwxr-xr-xscript/compare_cc_results.py3
2 files changed, 9 insertions, 7 deletions
diff --git a/script/autobuild.py b/script/autobuild.py
index fe1a96104fe..3a8ebe57cd1 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -3,6 +3,7 @@
# Copyright Andrew Tridgell 2010
# released under GNU GPL v3 or later
+from __future__ import print_function
from subprocess import call, check_call,Popen, PIPE
import os, tarfile, sys, time
from optparse import OptionParser
@@ -277,7 +278,7 @@ tasks = {
}
def do_print(msg):
- print "%s" % msg
+ print("%s" % msg)
sys.stdout.flush()
sys.stderr.flush()
@@ -452,9 +453,9 @@ class buildlist(object):
filename = 'system-info.txt'
f = open(filename, 'w')
for cmd in ['uname -a', 'free', 'cat /proc/cpuinfo']:
- print >>f, '### %s' % cmd
- print >>f, run_cmd(cmd, output=True, checkfail=False)
- print >>f
+ print('### %s' % cmd, file=f)
+ print(run_cmd(cmd, output=True, checkfail=False), file=f)
+ print(file=f)
f.close()
return filename
@@ -847,7 +848,7 @@ if options.email is not None:
elapsed_time, log_base=options.log_base)
else:
elapsed_minutes = elapsed_time / 60.0
- print '''
+ print('''
####################################################################
@@ -862,7 +863,7 @@ the autobuild has been abandoned. Please fix the error and resubmit.
####################################################################
-''' % (options.branch, platform.node(), elapsed_minutes, failed_task, errstr)
+''' % (options.branch, platform.node(), elapsed_minutes, failed_task, errstr))
cleanup()
do_print(errstr)
diff --git a/script/compare_cc_results.py b/script/compare_cc_results.py
index 1ab92490426..17b43f08d43 100755
--- a/script/compare_cc_results.py
+++ b/script/compare_cc_results.py
@@ -4,6 +4,7 @@
# Compare the results of native and cross-compiled configure tests
#
+from __future__ import print_function
import sys
import difflib
@@ -35,7 +36,7 @@ for fname in sys.argv[1:]:
if base_fname:
diff = list(difflib.unified_diff(base_lines,lines,base_fname,fname))
if diff:
- print 'configuration files %s and %s do not match' % (base_fname, fname)
+ print('configuration files %s and %s do not match' % (base_fname, fname))
for l in diff:
sys.stdout.write(l)
found_diff = True