mirror of https://github.com/python/cpython
[3.13] gh-113978: Ignore warnings on text completion inside REPL (GH-113979) (#119429)
(cherry picked from commit e03dde5a24
)
Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
This commit is contained in:
parent
e6e4efcc86
commit
6bc7fc08ae
|
@ -35,6 +35,7 @@ import inspect
|
||||||
import keyword
|
import keyword
|
||||||
import re
|
import re
|
||||||
import __main__
|
import __main__
|
||||||
|
import warnings
|
||||||
|
|
||||||
__all__ = ["Completer"]
|
__all__ = ["Completer"]
|
||||||
|
|
||||||
|
@ -88,10 +89,11 @@ class Completer:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if state == 0:
|
if state == 0:
|
||||||
if "." in text:
|
with warnings.catch_warnings(action="ignore"):
|
||||||
self.matches = self.attr_matches(text)
|
if "." in text:
|
||||||
else:
|
self.matches = self.attr_matches(text)
|
||||||
self.matches = self.global_matches(text)
|
else:
|
||||||
|
self.matches = self.global_matches(text)
|
||||||
try:
|
try:
|
||||||
return self.matches[state]
|
return self.matches[state]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Ignore warnings on text completion inside REPL.
|
Loading…
Reference in New Issue