Skip to content

Commit 6b4b0b5

Browse files
committed
-
1 parent 81e10a0 commit 6b4b0b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ipykernel/kernelbase.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@ async def _flush_control_queue(self):
257257
control_loop = self.io_loop
258258
tracer_future = awaitable_future = asyncio.Future()
259259

260-
def _flush():
260+
async def _flush():
261261
# control_stream.flush puts messages on the queue
262262
self.control_stream.flush()
263263
# put Future on the queue after all of those,
264264
# so we can wait for all queued messages to be processed
265-
self.control_queue.put(tracer_future)
265+
await self.control_queue.put(tracer_future)
266266

267-
control_loop.call_soon_threadsafe(_flush)
267+
asyncio.run_coroutine_threadsafe(_flush(), control_loop)
268268
return awaitable_future
269269

270270
async def process_control(self, msg):

0 commit comments

Comments
 (0)