qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH 9/9] iotests.py: use io.StringIO wi


From: Janosch Frank
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH 9/9] iotests.py: use io.StringIO with python3
Date: Wed, 20 Dec 2017 07:48:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

On 19.12.2017 18:34, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
>  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()

*Please* make a commit message that mentions that StringIO was moved
into the io package for py3. It took me way too long to make any sense
of this change until I read the except statement.
Maybe also add a comment.


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]