aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2021-06-07 16:06:14 -0400
committerJohn Snow <jsnow@redhat.com>2021-06-18 16:10:06 -0400
commitc4a1447fc13fd71df3813bfd451b98137f12b434 (patch)
treec74747b134114262b6c2fcfa5c3542c815f41eae /scripts
parent9669c8289c8f16eb97ac887ab09598925f4712ce (diff)
downloadqemu-c4a1447fc13fd71df3813bfd451b98137f12b434.zip
qemu-c4a1447fc13fd71df3813bfd451b98137f12b434.tar.gz
qemu-c4a1447fc13fd71df3813bfd451b98137f12b434.tar.bz2
scripts/qmp-shell: use @classmethod where appropriate
Methods with no self-use should belong to the class. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-8-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/qmp/qmp-shell6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell
index ae3f045..f354549 100755
--- a/scripts/qmp/qmp-shell
+++ b/scripts/qmp/qmp-shell
@@ -97,7 +97,8 @@ class FuzzyJSON(ast.NodeTransformer):
'''This extension of ast.NodeTransformer filters literal "true/false/null"
values in an AST and replaces them by proper "True/False/None" values that
Python can properly evaluate.'''
- def visit_Name(self, node):
+ @classmethod
+ def visit_Name(cls, node):
if node.id == 'true':
node.id = 'True'
if node.id == 'false':
@@ -152,7 +153,8 @@ class QMPShell(qmp.QEMUMonitorProtocol):
except Exception as e:
print("Failed to save history file '%s'; %s" % (self._histfile, e))
- def __parse_value(self, val):
+ @classmethod
+ def __parse_value(cls, val):
try:
return int(val)
except ValueError: