diff options
author | Lukáš Doktor | 2017-08-18 16:26:11 +0200 |
---|---|---|
committer | Eduardo Habkost | 2017-09-16 01:12:00 +0200 |
commit | 2cb05a3f3613f633b916b854cfaf04c663ccc953 (patch) | |
tree | 07c667ebae5cd6bfb92997a7cff9f40b619ae915 /scripts | |
parent | qmp.py: Use object-based class for QEMUMonitorProtocol (diff) | |
download | qemu-2cb05a3f3613f633b916b854cfaf04c663ccc953.tar.gz qemu-2cb05a3f3613f633b916b854cfaf04c663ccc953.tar.xz qemu-2cb05a3f3613f633b916b854cfaf04c663ccc953.zip |
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')
-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'] |