diff --git a/IPython/core/inputtransformer2.py b/IPython/core/inputtransformer2.py index 1abd2cf..c9aff48 100644 --- a/IPython/core/inputtransformer2.py +++ b/IPython/core/inputtransformer2.py @@ -24,6 +24,8 @@ def leading_indent(lines): If the first line starts with a spaces or tabs, the same whitespace will be removed from each following line in the cell. """ + if not lines: + return lines m = _indent_re.match(lines[0]) if not m: return lines