qemu-devel
[Top][All Lists]
Advanced

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

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


From: Lukáš Doktor
Subject: [Qemu-devel] [PATCH 08/11] qmp.py: Avoid "has_key" usage
Date: Thu, 20 Jul 2017 18:28:12 +0200

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

Signed-off-by: Lukáš Doktor <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 68f3420..a14b001 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 when 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]