py/rna: BPy_reports_to_error() now takes the exception type as an argument and returns -1 as an error value
This commit is contained in:
@@ -57,7 +57,7 @@ char *BPy_enum_as_string(EnumPropertyItem *item)
|
||||
return cstring;
|
||||
}
|
||||
|
||||
short BPy_reports_to_error(ReportList *reports, const short clear)
|
||||
short BPy_reports_to_error(ReportList *reports, PyObject *exception, const short clear)
|
||||
{
|
||||
char *report_str;
|
||||
|
||||
@@ -68,11 +68,11 @@ short BPy_reports_to_error(ReportList *reports, const short clear)
|
||||
}
|
||||
|
||||
if(report_str) {
|
||||
PyErr_SetString(PyExc_RuntimeError, report_str);
|
||||
PyErr_SetString(exception, report_str);
|
||||
MEM_freeN(report_str);
|
||||
}
|
||||
|
||||
return (report_str != NULL);
|
||||
return (report_str == NULL) ? 0 : -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user