From 036091f9df8ba31febff0fa6c232ad1ae12eef21 2017-02-09 10:34:58 From: Thomas Kluyver Date: 2017-02-09 10:34:58 Subject: [PATCH] Merge pull request #10244 from Carreau/protect-jedi Protect against jedi failing to get the type of a completion --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index d2637c4..ac77860 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -1554,11 +1554,17 @@ class IPCompleter(Completer): iter_jm = iter(jedi_matches) if _timeout: for jm in iter_jm: + try: + type_ = jm.type + except Exception: + if self.debug: + print("Error in Jedi getting type of ", jm) + type_ = None delta = len(jm.name_with_symbols) - len(jm.complete) yield Completion(start=offset - delta, end=offset, text=jm.name_with_symbols, - type=jm.type, + type=type_, _origin='jedi') if time.monotonic() > deadline: