diff options
author | Lukáš Doktor <ldoktor@redhat.com> | 2017-08-18 16:26:11 +0200 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2017-09-15 20:12:00 -0300 |
commit | 2cb05a3f3613f633b916b854cfaf04c663ccc953 (patch) | |
tree | 07c667ebae5cd6bfb92997a7cff9f40b619ae915 /scripts/qmp | |
parent | 3dd29b4133e4f6ad595bcd835fc0b3302a3304fe (diff) |
qmp.py: Avoid "has_key" usage
The "has_key" is deprecated in favor of "__in__" operator.
Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20170818142613.32394-9-ldoktor@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'scripts/qmp')
-rw-r--r-- | scripts/qmp/qmp.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/qmp/qmp.py b/scripts/qmp/qmp.py index 95ff5cc39a..f2f5a9b296 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'] |