diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py index ef8cd3f..f1f4444 100644 --- a/IPython/terminal/interactiveshell.py +++ b/IPython/terminal/interactiveshell.py @@ -238,7 +238,7 @@ class TerminalInteractiveShell(InteractiveShell): editing_mode=editing_mode, key_bindings_registry=kbmanager.registry, history=history, - completer=IPythonPTCompleter(self.Completer), + completer=IPythonPTCompleter(self), enable_history_search=True, style=style, mouse_support=self.mouse_support, diff --git a/IPython/terminal/ptutils.py b/IPython/terminal/ptutils.py index 092373e..1dd4b72 100644 --- a/IPython/terminal/ptutils.py +++ b/IPython/terminal/ptutils.py @@ -12,8 +12,12 @@ import pygments.lexers as pygments_lexers class IPythonPTCompleter(Completer): """Adaptor to provide IPython completions to prompt_toolkit""" - def __init__(self, ipy_completer): - self.ipy_completer = ipy_completer + def __init__(self, shell): + self.shell = shell + + @property + def ipy_completer(self): + return self.shell.Completer def get_completions(self, document, complete_event): if not document.current_line.strip():