From 2d2baeaf04d481f284bc2f098fb6d7ee9268151f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 6 Apr 2022 16:15:11 +1000 Subject: Fix: T78228 Send all python errors to info editor Python exceptions are now shown in the info editor, this also resolves an old bug where errors were printed twice. This was originally based on D9752 by @ShadowChaser although many changes have been made from the original patch. Details: - BPy_errors_to_report no longer prints additional output. - BKE_report_print_test was added so it's possible to check if calling BKE_report also printed to the stdout. - Callers to BPy_errors_to_report are responsible for ensuring output is printed to the stdout/stderr. - Python exceptions no longer add a trailing newline, needed to avoid blank-space when displayed in the info-editor. --- source/blender/editors/space_text/text_ops.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 49c0236866d..d4aac8dd57f 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -788,9 +788,7 @@ static int text_run_script(bContext *C, ReportList *reports) } } - BKE_report( - reports, RPT_ERROR, "Python script failed, check the message in the system console"); - + /* No need to report the error, this has already been handled by #BPY_run_text. */ return OPERATOR_FINISHED; } #else -- cgit v1.2.3