Skip to content

Commit d80d476

Browse files
committed
Flush streams
1 parent dbe263b commit d80d476

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
@@ -616,6 +616,9 @@ async def shell_channel_thread_main(self, msg):
616616
except Exception:
617617
self.log.error("Invalid message", exc_info=True) # noqa: G201
618618

619+
if self.shell_stream:
620+
self.shell_stream.flush()
621+
619622
async def shell_main(self, subshell_id: str | None, msg):
620623
"""Handler of shell messages for a single subshell"""
621624
if self._supports_kernel_subshells:
@@ -645,6 +648,7 @@ async def shell_main(self, subshell_id: str | None, msg):
645648
partial(self.shell_main, subshell_id),
646649
copy=False,
647650
)
651+
stream.flush()
648652

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

0 commit comments

Comments
 (0)