[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 07/10] qmp.py: Use object-based class for QEMUMon
From: |
Lukáš Doktor |
Subject: |
[Qemu-devel] [PATCH v4 07/10] qmp.py: Use object-based class for QEMUMonitorProtocol |
Date: |
Wed, 26 Jul 2017 16:42:23 +0200 |
There is no need to define QEMUMonitorProtocol as old-style class.
Signed-off-by: Lukáš Doktor <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
---
scripts/qmp/qmp-shell | 4 ++--
scripts/qmp/qmp.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell
index 860ffb2..be449de 100755
--- a/scripts/qmp/qmp-shell
+++ b/scripts/qmp/qmp-shell
@@ -106,7 +106,7 @@ class FuzzyJSON(ast.NodeTransformer):
# _execute_cmd()). Let's design a better one.
class QMPShell(qmp.QEMUMonitorProtocol):
def __init__(self, address, pretty=False):
- qmp.QEMUMonitorProtocol.__init__(self, self.__get_address(address))
+ super(QMPShell, self).__init__(self.__get_address(address))
self._greeting = None
self._completer = None
self._pretty = pretty
@@ -281,7 +281,7 @@ class QMPShell(qmp.QEMUMonitorProtocol):
return True
def connect(self, negotiate):
- self._greeting = qmp.QEMUMonitorProtocol.connect(self, negotiate)
+ self._greeting = super(QMPShell, self).connect(negotiate)
self.__completer_setup()
def show_banner(self, msg='Welcome to the QMP low-level shell!'):
diff --git a/scripts/qmp/qmp.py b/scripts/qmp/qmp.py
index 782d1ac..95ff5cc 100644
--- a/scripts/qmp/qmp.py
+++ b/scripts/qmp/qmp.py
@@ -30,7 +30,7 @@ class QMPTimeoutError(QMPError):
pass
-class QEMUMonitorProtocol:
+class QEMUMonitorProtocol(object):
#: Socket's error class
error = socket.error
--
2.9.4
- [Qemu-devel] [PATCH v4 00/10] qemu.py: Pylint/style fixes, Lukáš Doktor, 2017/07/26
- [Qemu-devel] [PATCH v4 01/10] qemu.py: Pylint/style fixes, Lukáš Doktor, 2017/07/26
- [Qemu-devel] [PATCH v4 02/10] qemu|qtest: Avoid dangerous arguments, Lukáš Doktor, 2017/07/26
- [Qemu-devel] [PATCH v4 03/10] qemu.py: Use iteritems rather than keys(), Lukáš Doktor, 2017/07/26
- [Qemu-devel] [PATCH v4 04/10] qemu.py: Simplify QMP key-conversion, Lukáš Doktor, 2017/07/26
- [Qemu-devel] [PATCH v4 05/10] qemu.py: Use custom exceptions rather than Exception, Lukáš Doktor, 2017/07/26
- [Qemu-devel] [PATCH v4 06/10] qmp.py: Couple of pylint/style fixes, Lukáš Doktor, 2017/07/26
- [Qemu-devel] [PATCH v4 07/10] qmp.py: Use object-based class for QEMUMonitorProtocol,
Lukáš Doktor <=
- [Qemu-devel] [PATCH v4 08/10] qmp.py: Avoid "has_key" usage, Lukáš Doktor, 2017/07/26
- [Qemu-devel] [PATCH v4 09/10] qmp.py: Avoid overriding a builtin object, Lukáš Doktor, 2017/07/26
- [Qemu-devel] [PATCH v4 10/10] qtest.py: Few pylint/style fixes, Lukáš Doktor, 2017/07/26