Skip to content

Commit e03dde5

Browse files
authored
gh-113978: Ignore warnings on text completion inside REPL (#113979)
1 parent 9db2fd7 commit e03dde5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Diff for: Lib/rlcompleter.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import keyword
3636
import re
3737
import __main__
38+
import warnings
3839

3940
__all__ = ["Completer"]
4041

@@ -88,10 +89,11 @@ def complete(self, text, state):
8889
return None
8990

9091
if state == 0:
91-
if "." in text:
92-
self.matches = self.attr_matches(text)
93-
else:
94-
self.matches = self.global_matches(text)
92+
with warnings.catch_warnings(action="ignore"):
93+
if "." in text:
94+
self.matches = self.attr_matches(text)
95+
else:
96+
self.matches = self.global_matches(text)
9597
try:
9698
return self.matches[state]
9799
except IndexError:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ignore warnings on text completion inside REPL.

0 commit comments

Comments
 (0)