From 0cf8ac5aa1dfcb8792bac9c96ba28c675790db25 2020-05-29 14:59:53 From: Matthias Bussonnier Date: 2020-05-29 14:59:53 Subject: [PATCH] Merge pull request #12346 from meeseeksmachine/auto-backport-of-pr-12305-on-7.x Backport PR #12305 on branch 7.x (Fix ipython#11508: check if line_buffer is None) --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 32144e1..bc114f0 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -1982,8 +1982,8 @@ class IPCompleter(Completer): # 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.