From cdefce51f5952fc826816ac1a299e55869c2fa44 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 31 Dec 2010 05:40:30 +0000 Subject: update python api with changes from Joshua's commit r33917. translate reports into python errors. --- source/blender/python/intern/bpy_util.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/python/intern/bpy_util.c') diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index 1ce3be0a82d..fb5b2a0d399 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -138,12 +138,16 @@ char *BPy_enum_as_string(EnumPropertyItem *item) return cstring; } -int BPy_reports_to_error(ReportList *reports) +short BPy_reports_to_error(ReportList *reports, const short clear) { char *report_str; report_str= BKE_reports_string(reports, RPT_ERROR); + if(clear) { + BKE_reports_clear(reports); + } + if(report_str) { PyErr_SetString(PyExc_SystemError, report_str); MEM_freeN(report_str); @@ -153,7 +157,7 @@ int BPy_reports_to_error(ReportList *reports) } -int BPy_errors_to_report(ReportList *reports) +short BPy_errors_to_report(ReportList *reports) { PyObject *pystring; PyObject *pystring_format= NULL; // workaround, see below -- cgit v1.2.3