[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/9] iotests: replace print statement by print() fun
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH 3/9] iotests: replace print statement by print() function for python3 compatibility |
Date: |
Tue, 19 Dec 2017 14:34:19 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
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 <http://www.gnu.org/licenses/>.
#
+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 <http://www.gnu.org/licenses/>.
#
+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
- [Qemu-devel] [PATCH 0/9] iotests: python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 1/9] qemu.py: replace iteritems() by items() for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 2/9] qmp.py: encode JSON unicode as byte strings for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 3/9] iotests: replace print statement by print() function for python3 compatibility,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 4/9] iotests: use octal numbers for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 5/9] iotests: replace xrange() by range() for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 6/9] iotests: replace dict.has_key() by 'in' operator for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 7/9] iotests: replace lambda function by lambda expression for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19
- [Qemu-devel] [PATCH 8/9] iotests: replace assertEquals() by assertEqual() for python3 compatibility, Philippe Mathieu-Daudé, 2017/12/19