From: Guido van Rossum Date: Fri, 12 Jun 1998 19:42:14 +0000 (+0000) Subject: In completer(), return None instead of raising an IndexError when X-Git-Tag: v1.5.2a1~475 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d458faadc303cef6fd07b9e22bfa9e08456426cf;p=thirdparty%2FPython%2Fcpython.git In completer(), return None instead of raising an IndexError when there are no more completions left. (This for compatibility with Donald Beaudry's code.) --- diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py index e0ae72c9aca3..92633abbc2fb 100644 --- a/Lib/rlcompleter.py +++ b/Lib/rlcompleter.py @@ -58,7 +58,10 @@ class Completer: self.matches = self.attr_matches(text) else: self.matches = self.global_matches(text) - return self.matches[state] + try: + return self.matches[state] + except IndexError: + return None def global_matches(self, text): """Compute matches when text is a simple name.