Skip to content

Commit d90d472

Browse files
committed
Once we've processed all pending cells, reset the abort flag
1 parent 0e52ce8 commit d90d472

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

itkwidgets/cell_watcher.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ def capture_event(self, stream: ZMQStream, ident: list, parent: dict) -> None:
197197
message as defined by the Jupyter message specification
198198
:type parent: dict
199199
"""
200+
if self._events.empty() and self.abort_all:
201+
# We've processed all pending cells, reset the abort flag
202+
self.abort_all = False
203+
200204
self._events.put((stream, ident, parent))
201205
if self._events.qsize() == 1 and self.ready_to_run_next_cell():
202206
# We've added a new task to an empty queue.
@@ -303,6 +307,7 @@ def update_namespace(self) -> None:
303307
self.shell.user_ns[key] = value.result()
304308
self.results.clear()
305309
except Exception as e:
310+
self.shell.user_ns[key] = e
306311
self.results.clear()
307312
self.abort_all = True
308313
self.create_task(self._execute_next_request)

0 commit comments

Comments
 (0)