Commit 2cb05a3f authored by Lukáš Doktor's avatar Lukáš Doktor Committed by Eduardo Habkost
Browse files

qmp.py: Avoid "has_key" usage



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

Signed-off-by: default avatarLukáš Doktor <ldoktor@redhat.com>
Reviewed-by: default avatarEduardo Habkost <ehabkost@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20170818142613.32394-9-ldoktor@redhat.com>
Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
parent 3dd29b41
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -197,7 +197,7 @@ class QEMUMonitorProtocol(object):
        Build and send a QMP command to the monitor, report errors if any
        Build and send a QMP command to the monitor, report errors if any
        """
        """
        ret = self.cmd(cmd, kwds)
        ret = self.cmd(cmd, kwds)
        if ret.has_key('error'):
        if "error" in ret:
            raise Exception(ret['error']['desc'])
            raise Exception(ret['error']['desc'])
        return ret['return']
        return ret['return']