Skip to content

Commit 9d3f7ae

Browse files
authored
Make iostream shutdown more robust (#1143)
1 parent ca79e2e commit 9d3f7ae

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ipykernel/iostream.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ def _start_event_gc():
9595
async def _cancel():
9696
self._event_pipe_gc_task.cancel() # type:ignore
9797

98-
try:
98+
if not self._stopped:
9999
self.io_loop.run_sync(_cancel)
100-
except TimeoutError:
101-
pass
100+
else:
101+
self._event_pipe_gc_task.cancel()
102+
102103
self.io_loop.close(all_fds=True)
103104

104105
def _setup_event_pipe(self):

0 commit comments

Comments
 (0)