Python: Print script errors with CLOG
Currently, when a python error is encountered when rendering the UI, the corresponding message is printed to stdout / stderr via `PyErr_Print`, this patch modifies behavior so that a cursory message is also printed with CLOG This has the benefit of allowing for testing via `--debug-exit-on-error`, which aborts Blender when an error message is printed. Pull Request: https://projects.blender.org/blender/blender/pulls/146296
This commit is contained in:
@@ -9835,6 +9835,13 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
|
||||
|
||||
/* Also print in the console for Python. */
|
||||
PyErr_Print();
|
||||
/* Print a small line at ERROR level so that tests that rely on --debug-exit-on-error can
|
||||
* fail. This assumes that the majority of the information is already seen in the console via
|
||||
* PyErr_Print and should not be duplicated */
|
||||
CLOG_ERROR(BPY_LOG_RNA,
|
||||
"Python script error in %.200s.%.200s",
|
||||
RNA_struct_identifier(ptr->type),
|
||||
RNA_function_identifier(func));
|
||||
}
|
||||
|
||||
bpy_context_clear(C, &gilstate);
|
||||
|
||||
Reference in New Issue
Block a user