bmesh operators exceptions were not cleared after raising as a python exception.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 13 Feb 2013 04:55:05 +0000 (04:55 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 13 Feb 2013 04:55:05 +0000 (04:55 +0000)
also clear before calling the operator.

source/blender/python/bmesh/bmesh_py_ops_call.c

index d4c8033589a9b559a1129b922ddecd8809be2c26..fad3e4a35cd97baf42513319ea9551f5cfbf7ed5 100644 (file)
 static int bpy_bm_op_as_py_error(BMesh *bm)
 {
        if (BMO_error_occurred(bm)) {
+               /* note: we could have multiple errors */
                const char *errmsg;
                if (BMO_error_get(bm, &errmsg, NULL)) {
                        PyErr_Format(PyExc_RuntimeError,
                                     "bmesh operator: %.200s",
                                     errmsg);
+                       BMO_error_clear(bm);
                        return -1;
                }
        }
@@ -692,6 +694,9 @@ PyObject *BPy_BMO_call(BPy_BMeshOpFunc *self, PyObject *args, PyObject *kw)
        {
                BPY_BM_CHECK_OBJ(py_bm);
                bm = py_bm->bm;
+
+               /* could complain about entering with exceptions... */
+               BMO_error_clear(bm);
        }
        else {
                PyErr_SetString(PyExc_TypeError,