From 3dd29b4133e4f6ad595bcd835fc0b3302a3304fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Fri, 18 Aug 2017 16:26:10 +0200 Subject: [PATCH] qmp.py: Use object-based class for QEMUMonitorProtocol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no need to define QEMUMonitorProtocol as old-style class. Signed-off-by: Lukáš Doktor Reviewed-by: Eduardo Habkost Message-Id: <20170818142613.32394-8-ldoktor@redhat.com> Signed-off-by: Eduardo Habkost --- 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 860ffb27f2..be449de621 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 782d1ac5df..95ff5cc39a 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