qemu-devel
[Top][All Lists]
Advanced

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

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


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH 08/11] qmp.py: Avoid "has_key" usage
Date: Fri, 21 Jul 2017 22:31:59 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/20/2017 01:28 PM, Lukáš Doktor wrote:
The "has_key" is deprecated in favor of "__in__" operator.

Signed-off-by: Lukáš Doktor <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 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']



reply via email to

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