Skip to content

Commit

Permalink
Examples: don't raise in a Traits observer (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdickinson committed Jul 28, 2021
1 parent 9d36edb commit 776ef71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/guide/examples/interruptible_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _report_result(self, event):
else:
# Shouldn't ever get here: CANCELLED, FAILED and COMPLETED
# are the only possible final states of a future.
raise RuntimeError(f"Unexpected state: {self.future.state}")
assert False, f"Impossible state: {self.future.state}"
self.future = None

@observe("future:result_event")
Expand Down
2 changes: 1 addition & 1 deletion docs/source/guide/examples/non_interruptible_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _report_result(self, event):
else:
# Shouldn't ever get here: CANCELLED, FAILED and COMPLETED
# are the only possible final states of a future.
raise RuntimeError(f"Unexpected state: {self.future.state}")
assert False, f"Impossible state: {self.future.state}"
self.future = None

def _get_can_calculate(self):
Expand Down

0 comments on commit 776ef71

Please sign in to comment.