From 51a7c29e8c9e28e18702e0e59e1b4eb9cc3eb0c1 Mon Sep 17 00:00:00 2001 From: Mehmet Bektas <40003442+mbektas@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:02:11 -0700 Subject: [PATCH] prevent error override, fix traceback type (#788) * prevent error override, fix traceback type * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- papermill/execute.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/papermill/execute.py b/papermill/execute.py index 7bae3fbf..eb76cc34 100644 --- a/papermill/execute.py +++ b/papermill/execute.py @@ -215,14 +215,18 @@ def raise_for_execution_errors(nb, output_path): break # handle the CellExecutionError exceptions raised that didn't produce a cell error output - if not has_sys_exit and cell.get("metadata", {}).get("papermill", {}).get("exception") is True: + if ( + error is None + and not has_sys_exit + and cell.get("metadata", {}).get("papermill", {}).get("exception") is True + ): error = PapermillExecutionError( cell_index=index, exec_count=cell.execution_count, source=cell.source, ename="CellExecutionError", evalue="", - traceback="", + traceback=[], ) break