Received: from eggs.gnu.org ([2001:4830:134:3::10]:32784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLoQ-0002It-9O for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:36:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLoL-0001nz-IX for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:36:18 -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:25 -0300 Message-Id: <20171219173425.8113-10-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 9/9] iotests.py: use io.StringIO with python3 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/iotests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 4c515d2e6c..0e1b8ab6e6 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -459,13 +459,16 @@ def main(supported_fmts=[], supported_oses=['linux']): # We need to filter out the time taken from the output so that qemu-iotest # can reliably diff the results against master output. - import StringIO if debug: output = sys.stdout verbosity = 2 sys.argv.remove('-d') else: - output = StringIO.StringIO() + try: + from StringIO import StringIO + except ImportError: + from io import StringIO + output = StringIO() logging.basicConfig(level=(logging.DEBUG if debug else logging.WARN)) -- 2.15.1