diff --git a/IPython/core/inputtransformer.py b/IPython/core/inputtransformer.py index 2c379dd..daf40b0 100644 --- a/IPython/core/inputtransformer.py +++ b/IPython/core/inputtransformer.py @@ -461,7 +461,7 @@ def classic_prompt(): def ipy_prompt(): """Strip IPython's In [1]:/...: prompts.""" # FIXME: non-capturing version (?:...) usable? - prompt_re = re.compile(r'^(In \[\d+\]: |\s*\.{3,}: )') + prompt_re = re.compile(r'^(In \[\d+\]: |\s*\.{3,}: ?)') return _strip_prompts(prompt_re) diff --git a/IPython/core/tests/test_inputtransformer.py b/IPython/core/tests/test_inputtransformer.py index bb5b576..4f11e22 100644 --- a/IPython/core/tests/test_inputtransformer.py +++ b/IPython/core/tests/test_inputtransformer.py @@ -233,6 +233,11 @@ syntax_ml = \ ('...: print i',' print i'), ('...: ', ''), ], + [('In [24]: for i in range(10):','for i in range(10):'), + # Space after last continuation prompt has been removed (issue #6674) + ('...: print i',' print i'), + ('...:', ''), + ], [('In [2]: a="""','a="""'), (' ...: 123"""','123"""'), ],