Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 497963c commit e96f4e5Copy full SHA for e96f4e5
1 file changed
IPython/terminal/ptutils.py
@@ -3,6 +3,7 @@
3
4
from IPython.utils.py3compat import PY3
5
6
+from IPython.core.completer import IPCompleter
7
from prompt_toolkit.completion import Completer, Completion
8
from prompt_toolkit.layout.lexers import Lexer
9
from prompt_toolkit.layout.lexers import PygmentsLexer
@@ -13,8 +14,11 @@
13
14
class IPythonPTCompleter(Completer):
15
"""Adaptor to provide IPython completions to prompt_toolkit"""
16
def __init__(self, shell):
17
+ if isinstance(shell, IPCompleter):
18
+ raise TypeError("IPythonPTCompleter expects an InteractiveShell"
19
+ " instance in IPython 5.1, not a Completer")
20
self.shell = shell
-
21
+
22
@property
23
def ipy_completer(self):
24
return self.shell.Completer
0 commit comments