@@ -152,7 +152,7 @@ def removed_co_newlocals(function:types.FunctionType) -> types.FunctionType:
152152
153153# we still need to run things using the asyncio eventloop, but there is no
154154# async integration
155- from .async_helpers import (_asyncio_runner , _asyncify )
155+ from .async_helpers import (_asyncio_runner , _asyncify , _pseudo_sync_runner )
156156
157157if sys .version_info > (3 , 5 ):
158158 from .async_helpers import _curio_runner , _trio_runner , _should_be_async
@@ -365,9 +365,10 @@ class InteractiveShell(SingletonConfigurable):
365365 ).tag (config = True )
366366
367367 loop_runner_map = {
368- 'asyncio' :_asyncio_runner ,
369- 'curio' :_curio_runner ,
370- 'trio' :_trio_runner ,
368+ 'asyncio' :(_asyncio_runner , True ),
369+ 'curio' :(_curio_runner , True ),
370+ 'trio' :(_trio_runner , True ),
371+ 'sync' : (_pseudo_sync_runner , False )
371372 }
372373
373374 loop_runner = Any (default_value = "IPython.core.interactiveshell._asyncio_runner" ,
@@ -383,7 +384,9 @@ def _default_loop_runner(self):
383384 def _import_runner (self , proposal ):
384385 if isinstance (proposal .value , str ):
385386 if proposal .value in self .loop_runner_map :
386- return self .loop_runner_map [proposal .value ]
387+ runner , autoawait = self .loop_runner_map [proposal .value ]
388+ self .autoawait = autoawait
389+ return runner
387390 runner = import_item (proposal .value )
388391 if not callable (runner ):
389392 raise ValueError ('loop_runner must be callable' )
@@ -2815,7 +2818,7 @@ def _run_cell(self, raw_cell, store_history, silent, shell_futures):
28152818 )
28162819
28172820 @asyncio .coroutine
2818- def run_cell_async (self , raw_cell , store_history = False , silent = False , shell_futures = True ):
2821+ def run_cell_async (self , raw_cell : str , store_history = False , silent = False , shell_futures = True ) -> ExecutionResult :
28192822 """Run a complete IPython cell asynchronously.
28202823
28212824 Parameters
0 commit comments