OSDN Git Service

qemu.py: Use items() instead of iteritems()
authorEduardo Habkost <ehabkost@redhat.com>
Mon, 12 Mar 2018 18:55:01 +0000 (15:55 -0300)
committerEduardo Habkost <ehabkost@redhat.com>
Mon, 12 Mar 2018 22:10:16 +0000 (19:10 -0300)
items() is less efficient on Python 2.x, but makes the code work
on both Python 2 and Python 3.

Cc: Lukáš Doktor <ldoktor@redhat.com>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Cc: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20180312185503.5746-2-ehabkost@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
scripts/qemu.py

index 305a946..08a3e9a 100644 (file)
@@ -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: