[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
- Re: [Qemu-devel] [PATCH 04/11] qemu.py: Simplify QMP key-conversion, (continued)
- [Qemu-devel] [PATCH 11/11] qtest.py: Avoid using mutable list as default argument, Lukáš Doktor, 2017/07/20
- [Qemu-devel] [PATCH 03/11] qemu.py: Use iteritems rather than keys(), Lukáš Doktor, 2017/07/20
- [Qemu-devel] [PATCH 02/11] qemu.py: Avoid dangerous arguments, Lukáš Doktor, 2017/07/20
- [Qemu-devel] [PATCH 08/11] qmp.py: Avoid "has_key" usage,
Lukáš Doktor <=
- [Qemu-devel] [PATCH 05/11] qemu.py: Use custom exceptions rather than Exception, Lukáš Doktor, 2017/07/20
- Re: [Qemu-devel] [PATCH 05/11] qemu.py: Use custom exceptions rather than Exception, Eduardo Habkost, 2017/07/20
- Re: [Qemu-devel] [PATCH 05/11] qemu.py: Use custom exceptions rather than Exception, Lukáš Doktor, 2017/07/21
- Re: [Qemu-devel] [PATCH 05/11] qemu.py: Use custom exceptions rather than Exception, Eduardo Habkost, 2017/07/21
- Re: [Qemu-devel] [PATCH 05/11] qemu.py: Use custom exceptions rather than Exception, Lukáš Doktor, 2017/07/24
- Re: [Qemu-devel] [PATCH 05/11] qemu.py: Use custom exceptions rather than Exception, Eduardo Habkost, 2017/07/24
- Re: [Qemu-devel] [PATCH 05/11] qemu.py: Use custom exceptions rather than Exception, Lukáš Doktor, 2017/07/25
[Qemu-devel] [PATCH 09/11] qmp.py: Avoid overriding a builtin object, Lukáš Doktor, 2017/07/20