File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1111# Imports
1212#-----------------------------------------------------------------------------
1313
14+ import asyncio
15+
1416# IPython imports
1517from traitlets import Type , Instance , default
1618from jupyter_client .clientabc import KernelClientABC
@@ -173,8 +175,13 @@ def _dispatch_to_kernel(self, msg):
173175 stream = kernel .shell_stream
174176 self .session .send (stream , msg )
175177 msg_parts = stream .recv_multipart ()
176- kernel .dispatch_shell (msg_parts )
177-
178+ loop = asyncio .get_event_loop ()
179+ # debug
180+ if not loop .is_running ():
181+ loop .run_until_complete (kernel .dispatch_shell (msg_parts ))
182+ else :
183+ loop .call_later (0 , kernel .dispatch_shell (msg_parts ))
184+
178185 idents , reply_msg = self .session .recv (stream , copy = False )
179186 self .shell_channel .call_handlers_later (reply_msg )
180187
You can’t perform that action at this time.
0 commit comments