From 9f7f0f79a3e8776164e7ae73eb4f40fce11e6539 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 27 Oct 2010 23:10:27 +0000 Subject: Make build scripts python2/3 agnostic. git-svn-id: svn://localhost/ardour2/branches/3.0@7931 d708f5d6-7413-0410-9779-e7cbd77b26cf --- autowaf.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'autowaf.py') diff --git a/autowaf.py b/autowaf.py index 7e8790a2ed..413a5fa24f 100644 --- a/autowaf.py +++ b/autowaf.py @@ -212,7 +212,7 @@ def configure(conf): display_msg(conf, "Debuggable build", str(conf.env['DEBUG'])) display_msg(conf, "Strict compiler flags", str(conf.env['STRICT'])) display_msg(conf, "Build documentation", str(conf.env['DOCS'])) - print + print() g_step = 2 @@ -340,11 +340,11 @@ def build_version_files(header_path, source_path, domain, major, minor, micro): text += "int " + domain + "_minor_version = " + str(minor) + ";\n" text += "int " + domain + "_micro_version = " + str(micro) + ";\n" try: - o = file(source_path, 'w') + o = open(source_path, 'w') o.write(text) o.close() except IOError: - print "Could not open", source_path, " for writing\n" + print("Could not open %s for writing\n", source_path) sys.exit(-1) text = "#ifndef __" + domain + "_version_h__\n" @@ -355,11 +355,11 @@ def build_version_files(header_path, source_path, domain, major, minor, micro): text += "extern int " + domain + "_micro_version;\n" text += "#endif /* __" + domain + "_version_h__ */\n" try: - o = file(header_path, 'w') + o = open(header_path, 'w') o.write(text) o.close() except IOError: - print "Could not open", header_path, " for writing\n" + print("Could not open %s for writing\n", header_path) sys.exit(-1) return None @@ -384,12 +384,12 @@ def run_tests(ctx, appname, tests): stdout=lcov_log, stderr=lcov_log) except: lcov = False - print "Failed to run lcov, no coverage report will be generated" + print("Failed to run lcov, no coverage report will be generated") # Run all tests for i in tests: - print + print() Utils.pprint('BOLD', 'Running %s test %s' % (appname, i)) if subprocess.call(i) == 0: Utils.pprint('GREEN', 'Passed %s %s' % (appname, i)) @@ -418,7 +418,7 @@ def run_tests(ctx, appname, tests): lcov_log.close() - print + print() Utils.pprint('BOLD', 'Summary:', sep=''), if failures == 0: Utils.pprint('GREEN', 'All ' + appname + ' tests passed') @@ -426,7 +426,7 @@ def run_tests(ctx, appname, tests): Utils.pprint('RED', str(failures) + ' ' + appname + ' test(s) failed') Utils.pprint('BOLD', 'Coverage:', sep='') - print os.path.abspath('coverage/index.html') + print(os.path.abspath('coverage/index.html')) os.chdir(orig_dir) -- cgit v1.2.3