33 PyErr_SetString(exception, report_str);
37 return (report_str ==
nullptr) ? 0 : -1;
43 for (report =
static_cast<const Report *
>(reports->
list.
first); report; report = report->
next) {
49 if (report ==
nullptr) {
54 PySys_WriteStdout(
"%s\n", header);
57 for (; report; report = report->
next) {
66 const char *error_prefix,
68 const bool use_location)
71 if (!PyErr_Occurred()) {
78 Py_ssize_t err_str_len;
79 const char *err_str = PyUnicode_AsUTF8AndSize(err_str_py, &err_str_len);
80 while (err_str_len > 0 && err_str[err_str_len - 1] ==
'\n') {
84 if (error_prefix ==
nullptr) {
86 error_prefix =
"Python";
89 const char *location_filepath =
nullptr;
90 int location_line_number = -1;
103 reports = &_reports_buf;
108 if (location_filepath) {
118 location_line_number);
124 if (reports != reports_orig) {
@ RPT_PRINT_HANDLED_BY_OWNER
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
char * BKE_reports_string(ReportList *reports, eReportType level)
void BKE_reports_free(ReportList *reports)
void BKE_reports_init(ReportList *reports, int flag)
void BKE_reports_move_to_reports(ReportList *reports_dst, ReportList *reports_src)
Read Guarded memory(de)allocation.
bool BPy_errors_to_report_ex(ReportList *reports, const char *error_prefix, const bool use_full, const bool use_location)
void BPy_reports_write_stdout(const ReportList *reports, const char *header)
short BPy_reports_to_error(ReportList *reports, PyObject *exception, const bool clear)
bool BPy_errors_to_report(ReportList *reports)
void MEM_freeN(void *vmemh)
static void clear(Message &msg)
PyObject * PyC_ExceptionBuffer()
PyObject * PyC_ExceptionBuffer_Simple()
void PyC_FileAndNum(const char **r_filename, int *r_lineno)