Show More
@@ -356,14 +356,21 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):' | |||
|
356 | 356 | tic = time.time() |
|
357 | 357 | self.client.hb_channel.unpause() |
|
358 | 358 | while True: |
|
359 | self.run_cell('1', False) | |
|
360 | if self.client.hb_channel.is_beating(): | |
|
361 | # heart failure was not the reason this returned | |
|
362 |
|
|
|
363 | else: | |
|
359 | msg_id = self.client.kernel_info() | |
|
360 | reply = None | |
|
361 | while True: | |
|
362 | try: | |
|
363 | reply = self.client.get_shell_msg(timeout=1) | |
|
364 | except Empty: | |
|
365 | break | |
|
366 | else: | |
|
367 | if reply['parent_header'].get('msg_id') == msg_id: | |
|
368 | return True | |
|
369 | if timeout is not None \ | |
|
370 | and (time.time() - tic) > timeout \ | |
|
371 | and not self.client.hb_channel.is_beating(): | |
|
364 | 372 | # heart failed |
|
365 | if timeout is not None and (time.time() - tic) > timeout: | |
|
366 | return False | |
|
373 | return False | |
|
367 | 374 | return True |
|
368 | 375 | |
|
369 | 376 | def interact(self, display_banner=None): |
@@ -386,7 +393,7 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):' | |||
|
386 | 393 | # run a non-empty no-op, so that we don't get a prompt until |
|
387 | 394 | # we know the kernel is ready. This keeps the connection |
|
388 | 395 | # message above the first prompt. |
|
389 |
if not self.wait_for_kernel( |
|
|
396 | if not self.wait_for_kernel(60): | |
|
390 | 397 | error("Kernel did not respond\n") |
|
391 | 398 | return |
|
392 | 399 | |
@@ -407,7 +414,7 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):' | |||
|
407 | 414 | if ans: |
|
408 | 415 | if self.manager: |
|
409 | 416 | self.manager.restart_kernel(True) |
|
410 |
self.wait_for_kernel( |
|
|
417 | self.wait_for_kernel(30) | |
|
411 | 418 | else: |
|
412 | 419 | self.exit_now = True |
|
413 | 420 | continue |
General Comments 0
You need to be logged in to leave comments.
Login now