diff options
author | John Snow <jsnow@redhat.com> | 2021-06-07 16:06:22 -0400 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2021-06-18 16:10:06 -0400 |
commit | 73f699c903d429dfcd3b43232155cd515a854e80 (patch) | |
tree | 14dd8eae9451af39e4ac07e7a8a87fd75535d2f3 /scripts/qmp | |
parent | d962ec85ed188b04f35a28771c69845f09a3867e (diff) |
scripts/qmp-shell: remove if-raise-else patterns
Shushes pylint. I don't always mind these patterns personally, but I'm
not as sure that I want to remove the warning from pylint's repertoire
entirely. Oh well.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 20210607200649.1840382-16-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'scripts/qmp')
-rwxr-xr-x | scripts/qmp/qmp-shell | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index 80cd432607..bf7a49dfc1 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -204,8 +204,7 @@ class QMPShell(qmp.QEMUMonitorProtocol): if type(parent[optpath[-1]]) is dict: msg = 'Cannot use "{:s}" as both leaf and non-leaf key' raise QMPShellError(msg.format('.'.join(curpath))) - else: - raise QMPShellError(f'Cannot set "{key}" multiple times') + raise QMPShellError(f'Cannot set "{key}" multiple times') parent[optpath[-1]] = value def __build_cmd(self, cmdline): @@ -309,13 +308,14 @@ class QMPShell(qmp.QEMUMonitorProtocol): except EOFError: print() return False + if cmdline == '': for event in self.get_events(): print(event) self.clear_events() return True - else: - return self._execute_cmd(cmdline) + + return self._execute_cmd(cmdline) def set_verbosity(self, verbose): self._verbose = verbose |