qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v4 08/10] qmp.py: Avoid "has_key" usage


From: Lukáš Doktor
Subject: [Qemu-devel] [PATCH v4 08/10] qmp.py: Avoid "has_key" usage
Date: Wed, 26 Jul 2017 16:42:24 +0200

The "has_key" is deprecated in favor of "__in__" operator.

Signed-off-by: Lukáš Doktor <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
 scripts/qmp/qmp.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qmp/qmp.py b/scripts/qmp/qmp.py
index 95ff5cc..f2f5a9b 100644
--- a/scripts/qmp/qmp.py
+++ b/scripts/qmp/qmp.py
@@ -197,7 +197,7 @@ class QEMUMonitorProtocol(object):
         Build and send a QMP command to the monitor, report errors if any
         """
         ret = self.cmd(cmd, kwds)
-        if ret.has_key('error'):
+        if "error" in ret:
             raise Exception(ret['error']['desc'])
         return ret['return']
 
-- 
2.9.4




reply via email to

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