diff --git a/pyiron_workflow/mixin/run.py b/pyiron_workflow/mixin/run.py index f563e1d2..aaefd929 100644 --- a/pyiron_workflow/mixin/run.py +++ b/pyiron_workflow/mixin/run.py @@ -338,20 +338,19 @@ def _finish_run( """ Switch the status, then process and return the run result. """ + if isinstance(run_output, Future) and run_output.cancelled(): + return None + + self.running = False try: if isinstance(run_output, Future): - # when the future is chancelled nothing happens - if run_output.cancelled(): - return None run_output = run_output.result() self.future = None if unique_executor: unique_executor.shutdown(wait=False) del unique_executor - self.running = False return self.process_run_result(run_output) except Exception as e: - self.running = False self._run_exception(**run_exception_kwargs) if raise_run_exceptions: raise e