From d8d6a8478a23970ef6c147c885db08332fad14fb 2013-11-06 21:10:12 From: Thomas Kluyver Date: 2013-11-06 21:10:12 Subject: [PATCH] Don't clear input if InputTransformer raises SyntaxError. --- diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py index 21398af..434e134 100644 --- a/IPython/terminal/interactiveshell.py +++ b/IPython/terminal/interactiveshell.py @@ -545,8 +545,8 @@ class TerminalInteractiveShell(InteractiveShell): self.input_splitter.push(line) more = self.input_splitter.push_accepts_more() except SyntaxError: - self.showsyntaxerror() - self.input_splitter.reset() + # Run the code directly - run_cell takes care of displaying + # the exception. more = False if (self.SyntaxTB.last_syntax_error and self.autoedit_syntax):