36 PyErr_SetString(exception, report_str);
40 return (report_str ==
nullptr) ? 0 : -1;
46 for (report =
static_cast<const Report *
>(reports->
list.
first); report; report = report->
next) {
52 if (report ==
nullptr) {
57 PySys_WriteStdout(
"%s\n", header);
60 for (; report; report = report->
next) {
69 const char *error_prefix,
71 const bool use_location)
74 if (!PyErr_Occurred()) {
81 Py_ssize_t err_str_len;
82 const char *err_str = PyUnicode_AsUTF8AndSize(err_str_py, &err_str_len);
83 while (err_str_len > 0 && err_str[err_str_len - 1] ==
'\n') {
87 if (error_prefix ==
nullptr) {
89 error_prefix =
"Python";
92 const char *location_filepath =
nullptr;
93 int location_line_number = -1;
106 reports = &_reports_buf;
111 if (location_filepath) {
121 location_line_number);
127 if (reports != reports_orig) {
133 Py_DECREF(err_str_py);
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)
@ RPT_PRINT_HANDLED_BY_OWNER
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)