##// END OF EJS Templates
Better handling of errors in multiline inputs.
gvaroquaux -
Show More
@@ -20,6 +20,7 import re
20
20
21 import IPython
21 import IPython
22 import sys
22 import sys
23 import codeop
23
24
24 from frontendbase import FrontEndBase
25 from frontendbase import FrontEndBase
25 from IPython.kernel.core.interpreter import Interpreter
26 from IPython.kernel.core.interpreter import Interpreter
@@ -148,7 +149,8 class LineFrontEndBase(FrontEndBase):
148 else:
149 else:
149 # Add line returns here, to make sure that the statement is
150 # Add line returns here, to make sure that the statement is
150 # complete.
151 # complete.
151 return FrontEndBase.is_complete(self, string.rstrip() + '\n\n')
152 return codeop.compile_command(string.rstrip() + '\n\n',
153 "<string>", "exec")
152
154
153
155
154 def write(self, string, refresh=True):
156 def write(self, string, refresh=True):
General Comments 0
You need to be logged in to leave comments. Login now