Kaydet (Commit) d458faad authored tarafından Guido van Rossum's avatar Guido van Rossum

In completer(), return None instead of raising an IndexError when

there are no more completions left.  (This for compatibility with
Donald Beaudry's code.)
üst b3f9f4b7
...@@ -58,7 +58,10 @@ class Completer: ...@@ -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)
return self.matches[state] try:
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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment