diff --git a/IPython/core/inputtransformer2.py b/IPython/core/inputtransformer2.py index 1abd2cf..3c992d8 100644 --- a/IPython/core/inputtransformer2.py +++ b/IPython/core/inputtransformer2.py @@ -636,7 +636,7 @@ class TransformerManager: MemoryError, SyntaxWarning): return 'invalid', None else: - if res is None: + if not lines[-1].strip().endswith(':'): return 'incomplete', find_last_indent(lines) return 'complete', None