From 75dc1c0bab811325814dad862b9dde1aec79aff8 2019-02-05 02:02:33 From: Matthias Bussonnier Date: 2019-02-05 02:02:33 Subject: [PATCH] Fix api compatibility. Wrap into the with provisionalCompleter() and return a list instead of an iterator just in case. Also add types hints. --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 716c126..5d24000 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -1134,13 +1134,14 @@ class IPCompleter(Completer): self.dict_key_matches, ] - def all_completions(self, text): + def all_completions(self, text) -> List[str]: """ Wrapper around the completions method for the benefit of emacs. """ prefix = text[:text.rfind(".") + 1] - return map(lambda c: prefix + c.text, - self.completions(text, len(text))) + with provisionalcompleter(): + return list(map(lambda c: prefix + c.text, + self.completions(text, len(text)))) return self.complete(text)[1]