Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-01-20 10:41:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-01-20 10:41:25 +0300
commitac058624ae45d67f6260962882ea5f09c6afcea4 (patch)
tree7aba4a6f28210f0320777969bd108e95aad5578a /source/blender/blenkernel/intern/report.c
parent287efe603637e5d5b3317db5a996dbe4a50609ad (diff)
fix for bug where python functions were not raising exceptions because reports were not added to the list in background mode.
Diffstat (limited to 'source/blender/blenkernel/intern/report.c')
-rw-r--r--source/blender/blenkernel/intern/report.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c
index a22b36b9524..e623c095ac7 100644
--- a/source/blender/blenkernel/intern/report.c
+++ b/source/blender/blenkernel/intern/report.c
@@ -96,11 +96,9 @@ void BKE_report(ReportList *reports, ReportType type, const char *message)
Report *report;
int len;
- /* exception, print and return in background, no reason to store a list */
- if(G.background)
- reports= NULL;
-
- if(!reports || ((reports->flag & RPT_PRINT) && (type >= reports->printlevel))) {
+ /* in background mode always print otherwise there are cases the errors wont be displayed,
+ * but still add to the report list since this is used for python exception handling */
+ if(G.background || !reports || ((reports->flag & RPT_PRINT) && (type >= reports->printlevel))) {
printf("%s: %s\n", report_type_str(type), message);
fflush(stdout); /* this ensures the message is printed before a crash */
}