mirror of
https://github.com/python/cpython.git
synced 2024-11-23 01:45:25 +08:00
gh-113978: Ignore warnings on text completion inside REPL (#113979)
This commit is contained in:
parent
9db2fd7eda
commit
e03dde5a24
@ -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:
|
||||
|
@ -0,0 +1 @@
|
||||
Ignore warnings on text completion inside REPL.
|
Loading…
Reference in New Issue
Block a user