Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PR #12305 on branch 7.x (Fix ipython#11508: check if line_buffer is None) #12346

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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