summaryrefslogtreecommitdiffstats
path: root/Lib/rlcompleter.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-05-22 21:13:32 (GMT)
committerGitHub <noreply@github.com>2024-05-22 21:13:32 (GMT)
commit6bc7fc08aef6142c034a9b67972b536a1a810a3e (patch)
treebb877578dbc1653c494ed27c981dccd22d8b87cd /Lib/rlcompleter.py
parente6e4efcc86ffecb9884ff64d622f3c6b659b7220 (diff)
downloadcpython-6bc7fc08aef6142c034a9b67972b536a1a810a3e.zip
cpython-6bc7fc08aef6142c034a9b67972b536a1a810a3e.tar.gz
cpython-6bc7fc08aef6142c034a9b67972b536a1a810a3e.tar.bz2
[3.13] gh-113978: Ignore warnings on text completion inside REPL (GH-113979) (#119429)
(cherry picked from commit e03dde5a24d3953e0b16f7cdefdc8b00aa9d9e11) Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
Diffstat (limited to 'Lib/rlcompleter.py')
-rw-r--r--Lib/rlcompleter.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py
index 206d6fb..23eb002 100644
--- a/Lib/rlcompleter.py
+++ b/Lib/rlcompleter.py
@@ -35,6 +35,7 @@ import inspect
import keyword
import re
import __main__
+import warnings
__all__ = ["Completer"]
@@ -88,10 +89,11 @@ class Completer:
return None
if state == 0:
- if "." in text:
- self.matches = self.attr_matches(text)
- else:
- self.matches = self.global_matches(text)
+ with warnings.catch_warnings(action="ignore"):
+ if "." in text:
+ self.matches = self.attr_matches(text)
+ else:
+ self.matches = self.global_matches(text)
try:
return self.matches[state]
except IndexError: