[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] qemu.py: Use items() instead of iteritems()
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] qemu.py: Use items() instead of iteritems() |
Date: |
Tue, 13 Mar 2018 00:02:39 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 03/12/2018 07:55 PM, Eduardo Habkost wrote:
> items() is less efficient on Python 2.x, but makes the code work
> on both Python 2 and Python 3.
>
> Cc: Lukáš Doktor <address@hidden>
> Cc: Philippe Mathieu-Daudé <address@hidden>
> Cc: Cleber Rosa <address@hidden>
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
> scripts/qemu.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/qemu.py b/scripts/qemu.py
> index 305a946562..08a3e9af5a 100644
> --- a/scripts/qemu.py
> +++ b/scripts/qemu.py
> @@ -277,7 +277,7 @@ class QEMUMachine(object):
> def qmp(self, cmd, conv_keys=True, **args):
> '''Invoke a QMP command and return the response dict'''
> qmp_args = dict()
> - for key, value in args.iteritems():
> + for key, value in args.items():
> if conv_keys:
> qmp_args[key.replace('_', '-')] = value
> else:
>
http://lists.nongnu.org/archive/html/qemu-devel/2017-12/msg04046.html
;)