diff options
author | John Snow <jsnow@redhat.com> | 2021-06-07 16:06:19 -0400 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2021-06-18 16:10:06 -0400 |
commit | 2813dee0536c1b5d114c0fa0bdeb25317a38f486 (patch) | |
tree | 21db5a7150760ebacc684d4df852cddd1411f9bd /scripts/qmp | |
parent | 50f6f1c3081322a1d9e2d0bbe5c9f434d712cf50 (diff) | |
download | qemu-2813dee0536c1b5d114c0fa0bdeb25317a38f486.zip qemu-2813dee0536c1b5d114c0fa0bdeb25317a38f486.tar.gz qemu-2813dee0536c1b5d114c0fa0bdeb25317a38f486.tar.bz2 |
scripts/qmp-shell: make QMPCompleter returns explicit
This function returns None when it doesn't find a match; do that
explicitly.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 20210607200649.1840382-13-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'scripts/qmp')
-rwxr-xr-x | scripts/qmp/qmp-shell | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index ea6a87e..8d84467 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -83,10 +83,10 @@ class QMPCompleter(list): def complete(self, text, state): for cmd in self: if cmd.startswith(text): - if not state: + if state == 0: return cmd - else: - state -= 1 + state -= 1 + return None class QMPShellError(Exception): |