diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-04-17 16:47:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-04-17 16:47:20 +0400 |
commit | 0862abf68bf1c9601080d4fb142c8f7edc6b300f (patch) | |
tree | 02a3c6fa59a2a78b0c6c1254fd22ac9bd9b18af5 /source/blender/python/intern/bpy_interface.c | |
parent | d00f664ee0c042569900110db21d567c21c391db (diff) |
change unit evaluation only to do try the units replacements if evaluating with python fails, in rare cases its possible a valid python expression could get units applied to it.
Diffstat (limited to 'source/blender/python/intern/bpy_interface.c')
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 83c52464c9c..555b42eb6fb 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -471,7 +471,8 @@ void BPY_DECREF(void *pyob_ptr) PyGILState_Release(gilstate); } -int BPY_button_exec(bContext *C, const char *expr, double *value) +/* return -1 on error, else 0 */ +int BPY_button_exec(bContext *C, const char *expr, double *value, const short verbose) { PyGILState_STATE gilstate; PyObject *py_dict, *mod, *retval; @@ -536,7 +537,12 @@ int BPY_button_exec(bContext *C, const char *expr, double *value) } if(error_ret) { - BPy_errors_to_report(CTX_wm_reports(C)); + if(verbose) { + BPy_errors_to_report(CTX_wm_reports(C)); + } + else { + PyErr_Clear(); + } } PyC_MainModule_Backup(&main_mod); |