From f25dcde2c10845a284494eb229c6d686b22aa51f Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Sun, 10 Oct 2021 09:02:58 +0300 Subject: [PATCH] Fix Jupyter notebook should always set Task as completed/stopped, never failed (exceptions are caught in interactive session) --- clearml/task.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clearml/task.py b/clearml/task.py index 4d7b2571..fb88fd15 100644 --- a/clearml/task.py +++ b/clearml/task.py @@ -2985,6 +2985,10 @@ class Task(_Task): except Exception: pass + # check if this is Jupyter interactive session, do not mark as exception + if 'IPython' in sys.modules: + is_exception = None + # only if we have an exception (and not ctrl-break) or signal is not SIGTERM / SIGINT if (is_exception and not isinstance(is_exception, KeyboardInterrupt) and is_exception != KeyboardInterrupt) \