File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 7676from pygments .util import ClassNotFound
7777from pygments .token import Token
7878
79- from jupyter_console .utils import run_sync
79+ from jupyter_console .utils import run_sync , ensure_async
8080
8181
8282def ask_yes_no (prompt , default = None , interrupt = None ):
@@ -839,9 +839,10 @@ def include_output(self, msg):
839839 async def handle_external_iopub (self , loop = None ):
840840 while self .keep_running :
841841 # we need to check for keep_running from time to time
842- poll_result = run_sync (self .client .iopub_channel .socket .poll )( 500 )
842+ poll_result = await ensure_async (self .client .iopub_channel .socket .poll ( 0 ) )
843843 if poll_result :
844844 self .handle_iopub ()
845+ await asyncio .sleep (0.5 )
845846
846847 def handle_iopub (self , msg_id = '' ):
847848 """Process messages on the IOPub channel
Original file line number Diff line number Diff line change 11import inspect
22import typing as t
3- from jupyter_core .utils import run_sync as _run_sync
3+ from jupyter_core .utils import run_sync as _run_sync , ensure_async # noqa
44
55
66T = t .TypeVar ("T" )
You can’t perform that action at this time.
0 commit comments