Skip to content

Commit 59110fc

Browse files
committed
Don't reify on REPL completion
1 parent c075f5b commit 59110fc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Lib/rlcompleter.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import re
3737
import __main__
3838
import warnings
39+
import types
3940

4041
__all__ = ["Completer"]
4142

@@ -188,7 +189,16 @@ def attr_matches(self, text):
188189
# property method, which is not desirable.
189190
matches.append(match)
190191
continue
191-
if (value := getattr(thisobject, word, None)) is not None:
192+
193+
if (isinstance(thisobject, types.ModuleType)
194+
and
195+
isinstance(thisobject.__dict__.get(word),types.LazyImportType)
196+
):
197+
value = thisobject.__dict__.get(word)
198+
else:
199+
value = getattr(thisobject, word, None)
200+
201+
if value is not None:
192202
matches.append(self._callable_postfix(value, match))
193203
else:
194204
matches.append(match)

0 commit comments

Comments
 (0)