Skip to content

Commit

Permalink
Merge pull request #12346 from meeseeksmachine/auto-backport-of-pr-12…
Browse files Browse the repository at this point in the history
…305-on-7.x

Backport PR #12305 on branch 7.x (Fix #11508: check if line_buffer is None)
  • Loading branch information
Carreau committed May 29, 2020
2 parents 7995cb2 + cd5bdd4 commit 0cf8ac5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IPython/core/completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1982,8 +1982,8 @@ def _complete(self, *, cursor_line, cursor_pos, line_buffer=None, text=None,
# if text is either None or an empty string, rely on the line buffer
if (not line_buffer) and full_text:
line_buffer = full_text.split('\n')[cursor_line]
if not text:
text = self.splitter.split_line(line_buffer, cursor_pos)
if not text: # issue #11508: check line_buffer before calling split_line
text = self.splitter.split_line(line_buffer, cursor_pos) if line_buffer else ''

if self.backslash_combining_completions:
# allow deactivation of these on windows.
Expand Down

0 comments on commit 0cf8ac5

Please sign in to comment.