35 PyErr_SetString(exception, report_str);
36 MEM_delete(report_str);
39 return (report_str ==
nullptr) ? 0 : -1;
45 for (report = reports->
list.first(); report; report = report->
next) {
51 if (report ==
nullptr) {
56 PySys_WriteStdout(
"%s\n", header);
59 for (; report; report = report->
next) {
68 const char *error_prefix,
70 const bool use_location)
73 if (!PyErr_Occurred()) {
80 Py_ssize_t err_str_len;
81 const char *err_str = PyUnicode_AsUTF8AndSize(err_str_py, &err_str_len);
82 while (err_str_len > 0 && err_str[err_str_len - 1] ==
'\n') {
86 if (error_prefix ==
nullptr) {
88 error_prefix =
"Python";
91 const char *location_filepath =
nullptr;
92 int location_line_number = -1;
105 reports = &_reports_buf;
110 if (location_filepath) {
120 location_line_number);
126 if (reports != reports_orig) {
132 Py_DECREF(err_str_py);
Read Blender memory allocation and freeing.
void BKE_reports_free(ReportList *reports)
void BKE_reports_init(ReportList *reports, int flag)
void BPy_reports_write_stdout(const ReportList *reports, const char *header)
void BKE_reports_move_to_reports(ReportList *reports_dst, ReportList *reports_src)
bool BPy_errors_to_report(ReportList *reports)
PyObject * PyC_ExceptionBuffer_Simple()
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void PyC_FileAndNum(const char **r_filename, int *r_lineno)
bool BPy_errors_to_report_ex(ReportList *reports, const char *error_prefix, const bool use_full, const bool use_location)
PyObject * PyC_ExceptionBuffer()
short BPy_reports_to_error(ReportList *reports, PyObject *exception, const bool clear)
@ RPT_PRINT_HANDLED_BY_OWNER
char * BKE_reports_string(ReportList *reports, eReportType level)