From ffe9604be2556b8b5c3f98bcc5283b00bf0c0dab Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 21 May 2016 12:25:02 +0100 Subject: meta/selftest/scripts: Use print function for python3 compatibility Used print function instead of print statement to make the code work in python 3. [Changes from both Ed and Richard] (From OE-Core rev: ced1995694c394d92cb82fb9c25a33dc027a3b69) Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- meta/lib/oe/qa.py | 2 +- meta/lib/oe/utils.py | 2 +- meta/lib/oeqa/runtime/files/test.py | 2 +- meta/lib/oeqa/runtime/systemd.py | 6 +++--- meta/lib/oeqa/selftest/base.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'meta/lib') diff --git a/meta/lib/oe/qa.py b/meta/lib/oe/qa.py index 3cfeee737b..cc2902f4af 100644 --- a/meta/lib/oe/qa.py +++ b/meta/lib/oe/qa.py @@ -148,4 +148,4 @@ if __name__ == "__main__": import sys elf = ELFFile(sys.argv[1]) elf.open() - print elf.isDynamic() + print(elf.isDynamic()) diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 30d30629f1..d1dfbfb95d 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -265,7 +265,7 @@ class ThreadedWorker(Thread): try: func(self, *args, **kargs) except Exception, e: - print e + print(e) finally: self.tasks.task_done() diff --git a/meta/lib/oeqa/runtime/files/test.py b/meta/lib/oeqa/runtime/files/test.py index f3a2273c52..f389225d72 100644 --- a/meta/lib/oeqa/runtime/files/test.py +++ b/meta/lib/oeqa/runtime/files/test.py @@ -3,4 +3,4 @@ import os os.system('touch /tmp/testfile.python') a = 9.01e+21 - 9.01e+21 + 0.01 -print "the value of a is %s" % a +print("the value of a is %s" % a) diff --git a/meta/lib/oeqa/runtime/systemd.py b/meta/lib/oeqa/runtime/systemd.py index 2b2f10d71c..a96efa28dc 100644 --- a/meta/lib/oeqa/runtime/systemd.py +++ b/meta/lib/oeqa/runtime/systemd.py @@ -153,7 +153,7 @@ class SystemdJournalTests(SystemdTest): if check_match: break # put the startup time in the test log if check_match: - print "%s" % check_match + print("%s" % check_match) else: self.skipTest("Error at obtaining the boot time from journalctl") boot_time_sec = 0 @@ -174,5 +174,5 @@ class SystemdJournalTests(SystemdTest): self.skipTest("Error when parsing time from boot string") #Assert the target boot time against systemd's unit start timeout if boot_time_sec > systemd_TimeoutStartSec: - print "Target boot time %s exceeds systemd's TimeoutStartSec %s"\ - %(boot_time_sec, systemd_TimeoutStartSec) + print("Target boot time %s exceeds systemd's TimeoutStartSec %s"\ + %(boot_time_sec, systemd_TimeoutStartSec)) diff --git a/meta/lib/oeqa/selftest/base.py b/meta/lib/oeqa/selftest/base.py index e10455edc1..b5a52fe57a 100644 --- a/meta/lib/oeqa/selftest/base.py +++ b/meta/lib/oeqa/selftest/base.py @@ -67,7 +67,7 @@ class oeSelfTest(unittest.TestCase): machine = custommachine machine_conf = 'MACHINE ??= "%s"\n' % machine self.set_machine_config(machine_conf) - print 'MACHINE: %s' % machine + print('MACHINE: %s' % machine) # tests might need their own setup # but if they overwrite this one they have to call -- cgit v1.2.3-54-g00ecf