Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e03dde5

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

File tree

2 files changed

+7
-4
lines changed
Filter options

2 files changed

+7
-4
lines changed

‎Lib/rlcompleter.py

Copy file name to clipboardExpand all lines: Lib/rlcompleter.py
+6-4Lines changed: 6 additions & 4 deletions
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:
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ignore warnings on text completion inside REPL.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.