mirror of
https://github.com/python/cpython
synced 2024-09-06 04:03:28 +00:00
bpo-44752: refactor part of rlcompleter.Completer.attr_matches (GH-27433)
This commit is contained in:
parent
50de8f74f8
commit
6741794dd4
|
@ -186,13 +186,10 @@ def attr_matches(self, text):
|
|||
# property method, which is not desirable.
|
||||
matches.append(match)
|
||||
continue
|
||||
try:
|
||||
val = getattr(thisobject, word)
|
||||
except Exception:
|
||||
pass # Include even if attribute not set
|
||||
if (value := getattr(thisobject, word, None)) is not None:
|
||||
matches.append(self._callable_postfix(value, match))
|
||||
else:
|
||||
match = self._callable_postfix(val, match)
|
||||
matches.append(match)
|
||||
matches.append(match)
|
||||
if matches or not noprefix:
|
||||
break
|
||||
if noprefix == '_':
|
||||
|
|
Loading…
Reference in a new issue