diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-05-26 14:36:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-05-26 14:36:49 +0300 |
commit | 8299284389fc4992128a15fff5b8269185933827 (patch) | |
tree | c644a3a935dc1f8778586a22e4300e68f9d96066 /source/blender/python | |
parent | 3c9da38e7e5a3009fa72bcb1fba703458d069380 (diff) |
Correct own recent error, uninitialized var use
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_util.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index 6e26104ea2a..5846ccd8757 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -87,9 +87,6 @@ bool BPy_errors_to_report_ex(ReportList *reports, const bool use_full, const boo PyObject *pystring; const char *cstring; - const char *filename; - int lineno; - if (!PyErr_Occurred()) return 1; @@ -115,6 +112,9 @@ bool BPy_errors_to_report_ex(ReportList *reports, const bool use_full, const boo cstring = _PyUnicode_AsString(pystring); if (use_location) { + const char *filename; + int lineno; + PyObject *pystring_format; /* workaround, see below */ PyC_FileAndNum(&filename, &lineno); @@ -130,13 +130,14 @@ bool BPy_errors_to_report_ex(ReportList *reports, const bool use_full, const boo BKE_report(reports, RPT_ERROR, cstring); Py_DECREF(pystring_format); /* workaround */ #endif + + /* not exactly needed. just for testing */ + fprintf(stderr, TIP_("%s\nlocation: %s:%d\n"), cstring, filename, lineno); } else { BKE_report(reports, RPT_ERROR, cstring); } - /* not exactly needed. just for testing */ - fprintf(stderr, TIP_("%s\nlocation: %s:%d\n"), cstring, filename, lineno); Py_DECREF(pystring); return 1; |