Skip to content

Commit

Permalink
Merge pull request #785 from ccordoba12/fix-channels-running-error
Browse files Browse the repository at this point in the history
Check that channels exist before asking if they are alive
  • Loading branch information
davidbrochart authored May 8, 2022
2 parents 63edf18 + 3784495 commit 4df8a48
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions jupyter_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,11 @@ def stop_channels(self) -> None:
def channels_running(self) -> bool:
"""Are any of the channels created and running?"""
return (
self.shell_channel.is_alive()
or self.iopub_channel.is_alive()
or self.stdin_channel.is_alive()
or self.hb_channel.is_alive()
or self.control_channel.is_alive()
(self._shell_channel and self.shell_channel.is_alive())
or (self._iopub_channel and self.iopub_channel.is_alive())
or (self._stdin_channel and self.stdin_channel.is_alive())
or (self._hb_channel and self.hb_channel.is_alive())
or (self._control_channel and self.control_channel.is_alive())
)

ioloop = None # Overridden in subclasses that use pyzmq event loop
Expand Down

0 comments on commit 4df8a48

Please sign in to comment.