From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLnQ-0001Oi-4Z for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLnO-0000b4-Oi for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:16 -0500 Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 19 Dec 2017 14:34:19 -0300 Message-Id: <20171219173425.8113-4-f4bug@amsat.org> In-Reply-To: <20171219173425.8113-1-f4bug@amsat.org> References: <20171219173425.8113-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 3/9] iotests: replace print statement by print() function for python3 compatibility List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , Max Reitz , Cleber Rosa , Eduardo Habkost , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , "Daniel P . Berrange" , Eric Blake , Stefan Hajnoczi , Fam Zheng , Markus Armbruster Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, qemu-block@nongnu.org, John Snow , Paolo Bonzini , Nir Soffer , Janosch Frank , Ishani Chugh Signed-off-by: Philippe Mathieu-Daudé --- tests/qemu-iotests/149 | 3 ++- tests/qemu-iotests/165 | 3 ++- tests/qemu-iotests/iotests.py | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/149 b/tests/qemu-iotests/149 index 223cd68ad5..d3ffa259db 100755 --- a/tests/qemu-iotests/149 +++ b/tests/qemu-iotests/149 @@ -20,6 +20,7 @@ # Exercise the QEMU 'luks' block driver to validate interoperability # with the Linux dm-crypt + cryptsetup implementation +from __future__ import print_function import subprocess import os import os.path @@ -376,7 +377,7 @@ def test_once(config, qemu_img=False): finally: iotests.log("# Delete image") delete_image(config) - print + print() # Obviously we only work with the luks image format diff --git a/tests/qemu-iotests/165 b/tests/qemu-iotests/165 index a3932db3de..ab29066076 100755 --- a/tests/qemu-iotests/165 +++ b/tests/qemu-iotests/165 @@ -18,6 +18,7 @@ # along with this program. If not, see . # +from __future__ import print_function import os import re import iotests @@ -85,7 +86,7 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase): log = re.sub(r'^\[I \d+\.\d+\] OPENED\n', '', log) log = re.sub(r'\[I \+\d+\.\d+\] CLOSED\n?$', '', log) if log: - print log + print(log) self.vm = self.mkVm() self.vm.launch() diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 6f057904a9..85c9d2c211 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # +from __future__ import print_function import errno import os import re @@ -145,7 +146,7 @@ def filter_qmp_event(event): def log(msg, filters=[]): for flt in filters: msg = flt(msg) - print msg + print(msg) class Timeout: def __init__(self, seconds, errmsg = "Timeout"): @@ -417,7 +418,7 @@ def notrun(reason): seq = os.path.basename(sys.argv[0]) open('%s/%s.notrun' % (output_dir, seq), 'wb').write(reason + '\n') - print '%s not run: %s' % (seq, reason) + print("{} not run: {}".format(seq, reason)) sys.exit(0) def verify_image_format(supported_fmts=[], unsupported_fmts=[]): -- 2.15.1