From cd5bdd4968bf8fe0236aad1750d852cf41882c85 2020-05-27 23:29:41 From: Matthias Bussonnier Date: 2020-05-27 23:29:41 Subject: [PATCH] Backport PR #12305: 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.