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.

This commit is contained in:
2011-04-17 12:47:20 +00:00
parent d00f664ee0
commit 0862abf68b
3 changed files with 30 additions and 15 deletions

View File

@@ -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);