##// END OF EJS Templates
Don't catch failure to import Jedi...
Thomas Kluyver -
Show More
@@ -77,13 +77,9 b' from IPython.utils.process import arg_split'
77 77 from IPython.utils.py3compat import builtin_mod, string_types, PY3, cast_unicode_py2
78 78 from traitlets import CBool, Enum
79 79
80 try:
81 import jedi
82 import jedi.api.helpers
83 import jedi.parser.user_context
84 JEDI_INSTALLED = True
85 except ImportError:
86 JEDI_INSTALLED = False
80 import jedi
81 import jedi.api.helpers
82 import jedi.parser.user_context
87 83
88 84 #-----------------------------------------------------------------------------
89 85 # Globals
@@ -586,9 +582,6 b' class IPCompleter(Completer):'
586 582 When False [default]: the __all__ attribute is ignored
587 583 """
588 584 )
589 use_jedi_completions = CBool(default_value=JEDI_INSTALLED, config=True,
590 help="""Use Jedi to generate autocompletions.
591 """)
592 585
593 586 def __init__(self, shell=None, namespace=None, global_namespace=None,
594 587 use_readline=True, config=None, **kwargs):
@@ -832,8 +825,6 b' class IPCompleter(Completer):'
832 825
833 826 def python_matches(self, text):
834 827 """Match attributes or global python names"""
835 # Jedi completion
836
837 828 if "." in text:
838 829 try:
839 830 matches = self.attr_matches(text)
@@ -1264,8 +1255,7 b' class IPCompleter(Completer):'
1264 1255 # different types of objects. The rlcomplete() method could then
1265 1256 # simply collapse the dict into a list for readline, but we'd have
1266 1257 # richer completion semantics in other evironments.
1267 if self.use_jedi_completions:
1268 self.matches.extend(self.python_jedi_matches(text, line_buffer, cursor_pos))
1258 self.matches.extend(self.python_jedi_matches(text, line_buffer, cursor_pos))
1269 1259
1270 1260 self.matches = sorted(set(self.matches), key=completions_sorting_key)
1271 1261
General Comments 0
You need to be logged in to leave comments. Login now