diff --git a/IPython/core/inputtransformer2.py b/IPython/core/inputtransformer2.py index d53f702..64813ec 100644 --- a/IPython/core/inputtransformer2.py +++ b/IPython/core/inputtransformer2.py @@ -653,6 +653,9 @@ class TransformerManager: if res is None: return 'incomplete', find_last_indent(lines) + if toks_last_line[-2].type in {tokenize.NEWLINE, tokenize.NL}: + return 'complete', None + if toks_last_line[-2].type == tokenize.DEDENT: if not lines[-1].endswith('\n'): return 'incomplete', find_last_indent(lines)