mirror of
https://github.com/python/cpython.git
synced 2025-10-14 10:53:40 +00:00
In completer(), return None instead of raising an IndexError when
there are no more completions left. (This for compatibility with Donald Beaudry's code.)
This commit is contained in:
parent
b3f9f4b729
commit
d458faadc3
1 changed files with 4 additions and 1 deletions
|
@ -58,7 +58,10 @@ class Completer:
|
||||||
self.matches = self.attr_matches(text)
|
self.matches = self.attr_matches(text)
|
||||||
else:
|
else:
|
||||||
self.matches = self.global_matches(text)
|
self.matches = self.global_matches(text)
|
||||||
|
try:
|
||||||
return self.matches[state]
|
return self.matches[state]
|
||||||
|
except IndexError:
|
||||||
|
return None
|
||||||
|
|
||||||
def global_matches(self, text):
|
def global_matches(self, text):
|
||||||
"""Compute matches when text is a simple name.
|
"""Compute matches when text is a simple name.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue