Skip to content

Commit 1483408

Browse files
committed
Don't assume kernels have loops.
In particular the in-process kernels don't. This does not fix all the issues in particular the quit() and exit() autocaller that become no-op, but that's another story
1 parent d14db6a commit 1483408

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ipykernel/zmqshell.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,9 @@ def _default_exiter(self):
464464
def _update_exit_now(self, change):
465465
"""stop eventloop when exit_now fires"""
466466
if change['new']:
467-
loop = self.kernel.io_loop
468-
loop.call_later(0.1, loop.stop)
467+
if hasattr(self.kernel, 'io_loop'):
468+
loop = self.kernel.io_loop
469+
loop.call_later(0.1, loop.stop)
469470
if self.kernel.eventloop:
470471
exit_hook = getattr(self.kernel.eventloop, 'exit_hook', None)
471472
if exit_hook:

0 commit comments

Comments
 (0)