Skip to content

Commit 291a5d3

Browse files
fix bpython#483 temporarily
1 parent d2d236d commit 291a5d3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bpython/autocomplete.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,19 @@ def matches(self, cursor_offset, line, **kwargs):
367367
if not lineparts.current_word(cursor_offset, line):
368368
return None
369369
history = '\n'.join(history) + '\n' + line
370+
370371
try:
371372
script = jedi.Script(history, len(history.splitlines()),
372373
cursor_offset, 'fake.py')
373374
completions = script.completions()
374375
except jedi.NotFoundError:
375376
self._orig_start = None
376377
return None
378+
except IndexError:
379+
# for https://github.com/bpython/bpython/issues/483
380+
self._orig_start = None
381+
return None
382+
377383
if completions:
378384
diff = len(completions[0].name) - len(completions[0].complete)
379385
self._orig_start = cursor_offset - diff

0 commit comments

Comments
 (0)