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>
This commit is contained in:
parent
50f6f1c308
commit
2813dee053
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user