Skip to content

Commit fdcef67

Browse files
committed
Execute code in blocking mode by default
1 parent a7d66ae commit fdcef67

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

ipykernel/ipkernel.py

+1
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ async def run(execution: Execution) -> None:
411411
try:
412412
async with create_task_group() as tg:
413413
execution = Execution()
414+
self.shell_is_blocking = False
414415
self.shell_is_awaiting = True
415416
tg.start_soon(run, execution)
416417
execution.interrupt = await to_thread.run_sync(self.shell_interrupt.get)

ipykernel/kernelbase.py

+2
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,9 @@ async def execute_request(self, socket, ident, parent):
659659
do_execute_args["cell_id"] = cell_id
660660

661661
# Call do_execute with the appropriate arguments
662+
self.shell_is_blocking = True
662663
reply_content = self.do_execute(**do_execute_args)
664+
self.shell_is_blocking = False
663665

664666
if inspect.isawaitable(reply_content):
665667
reply_content = await reply_content

0 commit comments

Comments
 (0)