From 2546630687eec72d4eaf35513276a6a513ebe4b0 2020-05-27 23:29:29 From: Matthias Bussonnier Date: 2020-05-27 23:29:29 Subject: [PATCH] Merge pull request #12305 from TheHubbit/master Fix ipython#11508: check if line_buffer is None --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index dd09add..526aed6 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -2055,8 +2055,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.