diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py index aa1dd0246b8..7a248feff38 100644 --- a/Lib/rlcompleter.py +++ b/Lib/rlcompleter.py @@ -76,7 +76,7 @@ def global_matches(self, text): __builtin__.__dict__.keys(), __main__.__dict__.keys()]: for word in list: - if word[:n] == text: + if word[:n] == text and word != "__builtins__": matches.append(word) return matches @@ -106,7 +106,7 @@ def attr_matches(self, text): matches = [] n = len(attr) for word in words: - if word[:n] == attr: + if word[:n] == attr and word != "__builtins__": matches.append("%s.%s" % (expr, word)) return matches