Show More
@@ -2808,14 +2808,24 b' class InteractiveShell(SingletonConfigurable):' | |||
|
2808 | 2808 | |
|
2809 | 2809 | def _run_cell(self, raw_cell, store_history, silent, shell_futures): |
|
2810 | 2810 | """Internal method to run a complete IPython cell.""" |
|
2811 | return self.loop_runner( | |
|
2812 | self.run_cell_async( | |
|
2811 | coro = self.run_cell_async( | |
|
2813 | 2812 |
|
|
2814 | 2813 |
|
|
2815 | 2814 |
|
|
2816 | 2815 |
|
|
2817 | 2816 |
|
|
2818 | ) | |
|
2817 | ||
|
2818 | try: | |
|
2819 | interactivity = coro.send(None) | |
|
2820 | except StopIteration as exc: | |
|
2821 | return exc.value | |
|
2822 | ||
|
2823 | if isinstance(interactivity, ExecutionResult): | |
|
2824 | return interactivity | |
|
2825 | ||
|
2826 | if interactivity == 'async': | |
|
2827 | return self.loop_runner(coro) | |
|
2828 | return _pseudo_sync_runner(coro) | |
|
2819 | 2829 | |
|
2820 | 2830 | @asyncio.coroutine |
|
2821 | 2831 | def run_cell_async(self, raw_cell:str, store_history=False, silent=False, shell_futures=True) -> ExecutionResult: |
@@ -2965,6 +2975,9 b' class InteractiveShell(SingletonConfigurable):' | |||
|
2965 | 2975 | interactivity = "none" if silent else self.ast_node_interactivity |
|
2966 | 2976 | if _run_async: |
|
2967 | 2977 | interactivity = 'async' |
|
2978 | # yield interactivity so let run_cell decide whether to use | |
|
2979 | # an async loop_runner | |
|
2980 | yield interactivity | |
|
2968 | 2981 | has_raised = yield from self.run_ast_nodes(code_ast.body, cell_name, |
|
2969 | 2982 | interactivity=interactivity, compiler=compiler, result=result) |
|
2970 | 2983 |
General Comments 0
You need to be logged in to leave comments.
Login now