From 2813dee0536c1b5d114c0fa0bdeb25317a38f486 Mon Sep 17 00:00:00 2001 From: John Snow Date: Mon, 7 Jun 2021 16:06:19 -0400 Subject: 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 Message-id: 20210607200649.1840382-13-jsnow@redhat.com Signed-off-by: John Snow --- scripts/qmp/qmp-shell | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') 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): -- cgit v1.1