Show More
@@ -535,8 +535,15 b' class IPythonInputSplitter(InputSplitter):' | |||
|
535 | 535 | self.source_raw = '' |
|
536 | 536 | self.transformer_accumulating = False |
|
537 | 537 | self.within_python_line = False |
|
538 | ||
|
539 | last_exc = None | |
|
538 | 540 | for t in self.transforms: |
|
539 |
t |
|
|
541 | try: | |
|
542 | t.reset() | |
|
543 | except SyntaxError as e: | |
|
544 | last_exc = e | |
|
545 | if last_exc is not None: | |
|
546 | raise last_exc | |
|
540 | 547 | |
|
541 | 548 | def flush_transformers(self): |
|
542 | 549 | def _flush(transform, out): |
@@ -204,8 +204,14 b' class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):' | |||
|
204 | 204 | prompt created. When triggered by an Enter/Return key press, |
|
205 | 205 | 'interactive' is True; otherwise, it is False. |
|
206 | 206 | """ |
|
207 | self._input_splitter.reset() | |
|
208 |
|
|
|
207 | try: | |
|
208 | self._input_splitter.reset() | |
|
209 | except SyntaxError: | |
|
210 | pass | |
|
211 | try: | |
|
212 | complete = self._input_splitter.push(source) | |
|
213 | except SyntaxError: | |
|
214 | return True | |
|
209 | 215 | if interactive: |
|
210 | 216 | complete = not self._input_splitter.push_accepts_more() |
|
211 | 217 | return complete |
@@ -233,7 +239,10 b' class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):' | |||
|
233 | 239 | """ |
|
234 | 240 | # Flush all state from the input splitter so the next round of |
|
235 | 241 | # reading input starts with a clean buffer. |
|
236 | self._input_splitter.reset() | |
|
242 | try: | |
|
243 | self._input_splitter.reset() | |
|
244 | except SyntaxError: | |
|
245 | pass | |
|
237 | 246 | |
|
238 | 247 | if not self._reading: |
|
239 | 248 | self._highlighter.highlighting_on = False |
General Comments 0
You need to be logged in to leave comments.
Login now