From 1d8404291e435eb4f173e0206accec7f90cc8a08 Mon Sep 17 00:00:00 2001 From: Kirill Kouzoubov Date: Sat, 19 Oct 2019 23:56:33 +1100 Subject: [PATCH] Handle exceptions better Communicate back that cell execution was aborted in case of exception during cell replay. --- jupyter_ui_poll/_poll.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jupyter_ui_poll/_poll.py b/jupyter_ui_poll/_poll.py index bdeb48b..934da30 100644 --- a/jupyter_ui_poll/_poll.py +++ b/jupyter_ui_poll/_poll.py @@ -12,10 +12,10 @@ def _replay_events(shell, events): sys.stderr.flush() for stream, ident, parent in events: kernel.set_parent(ident, parent) - kernel.execute_request(stream, ident, parent) - if shell._last_traceback is not None: - # there was an exception drop rest on the floor - break + if kernel._aborting: + kernel._send_abort_reply(stream, parent, ident) + else: + kernel.execute_request(stream, ident, parent) @contextmanager