Skip to content

Commit 04ca930

Browse files
committed
Work around jedi bugs (fixes bpython#544)
This might break jedi based completion. Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 72be2cd commit 04ca930

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

bpython/autocomplete.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,9 @@ def matches(self, cursor_offset, line, **kwargs):
479479
script = jedi.Script(history, len(history.splitlines()),
480480
cursor_offset, 'fake.py')
481481
completions = script.completions()
482-
except jedi.NotFoundError:
483-
self._orig_start = None
484-
return None
485-
except IndexError:
486-
# for #483
482+
except (jedi.NotFoundError, IndexError, KeyError):
483+
# IndexError for #483
484+
# KeyError for #544
487485
self._orig_start = None
488486
return None
489487

0 commit comments

Comments
 (0)