We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc298e4 commit 991cd08Copy full SHA for 991cd08
ipykernel/kernelbase.py
@@ -492,6 +492,19 @@ async def process_one(self, wait=True):
492
t, dispatch, args = self.msg_queue.get_nowait()
493
except (asyncio.QueueEmpty, QueueEmpty):
494
return
495
+
496
+ if self.control_thread is None:
497
+ # If there isn't a separate control thread then this main thread handles both shell
498
+ # and control messages. Before processing a shell message need to flush all control
499
+ # messages and allow them all to be processed.
500
+ await asyncio.sleep(0)
501
+ self.control_stream.flush()
502
503
+ socket = self.control_stream.socket
504
+ while socket.poll(1):
505
506
507
508
await dispatch(*args)
509
510
async def dispatch_queue(self):
0 commit comments