Skip to content

Commit d8df24d

Browse files
committed
Flush streams
1 parent d29d2ee commit d8df24d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ipykernel/kernelbase.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,9 @@ async def shell_channel_thread_main(self, msg):
617617
except Exception:
618618
self.log.error("Invalid message", exc_info=True) # noqa: G201
619619

620+
if self.shell_stream:
621+
self.shell_stream.flush()
622+
620623
async def shell_main(self, subshell_id: str | None, msg):
621624
"""Handler of shell messages for a single subshell"""
622625
if self._supports_kernel_subshells:
@@ -646,6 +649,7 @@ async def shell_main(self, subshell_id: str | None, msg):
646649
partial(self.shell_main, subshell_id),
647650
copy=False,
648651
)
652+
stream.flush()
649653

650654
def record_ports(self, ports):
651655
"""Record the ports that this kernel is using.

0 commit comments

Comments
 (0)