mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-03 10:43:28 +00:00
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):
|
def complete(self, text, state):
|
||||||
for cmd in self:
|
for cmd in self:
|
||||||
if cmd.startswith(text):
|
if cmd.startswith(text):
|
||||||
if not state:
|
if state == 0:
|
||||||
return cmd
|
return cmd
|
||||||
else:
|
state -= 1
|
||||||
state -= 1
|
return None
|
||||||
|
|
||||||
|
|
||||||
class QMPShellError(Exception):
|
class QMPShellError(Exception):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user