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 76
76
from pygments .util import ClassNotFound
77
77
from pygments .token import Token
78
78
79
- from jupyter_console .utils import run_sync
79
+ from jupyter_console .utils import run_sync , ensure_async
80
80
81
81
82
82
def ask_yes_no (prompt , default = None , interrupt = None ):
@@ -839,9 +839,10 @@ def include_output(self, msg):
839
839
async def handle_external_iopub (self , loop = None ):
840
840
while self .keep_running :
841
841
# 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 ) )
843
843
if poll_result :
844
844
self .handle_iopub ()
845
+ await asyncio .sleep (0.5 )
845
846
846
847
def handle_iopub (self , msg_id = '' ):
847
848
"""Process messages on the IOPub channel
Original file line number Diff line number Diff line change 1
1
import inspect
2
2
import 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
4
4
5
5
6
6
T = t .TypeVar ("T" )
You can’t perform that action at this time.
0 commit comments