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>2009-08-09 17:20:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-08-09 17:20:12 +0400
commit2a408c864fab1bafa8f4130a2fc4a08c8133a39f (patch)
treef1c394b47798f2dd8bddd434ac79feaff707b2fd /source/blender/python/intern/bpy_operator_wrap.c
parent21302619f824dd8e92b5295b30c57dda460c1e63 (diff)
- fix error in last commit
- added better error feedback when registering operators fails. - added some python benchmark timers (prints on exit), times number of times py scripts run, average time and total % of time running py scripts.
Diffstat (limited to 'source/blender/python/intern/bpy_operator_wrap.c')
-rw-r--r--source/blender/python/intern/bpy_operator_wrap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c
index 7a92c747bd3..a0cbc4637a4 100644
--- a/source/blender/python/intern/bpy_operator_wrap.c
+++ b/source/blender/python/intern/bpy_operator_wrap.c
@@ -296,7 +296,7 @@ void PYTHON_OT_wrapper(wmOperatorType *ot, void *userdata)
PyObject *py_func_ptr, *py_kw, *py_srna_cobject, *py_ret;
item = PyList_GET_ITEM(props, i);
- if (PyArg_ParseTuple(item, "O!O!", &PyCObject_Type, &py_func_ptr, &PyDict_Type, &py_kw)) {
+ if (PyArg_ParseTuple(item, "O!O!:PYTHON_OT_wrapper", &PyCObject_Type, &py_func_ptr, &PyDict_Type, &py_kw)) {
PyObject *(*pyfunc)(PyObject *, PyObject *, PyObject *);
pyfunc = PyCObject_AsVoidPtr(py_func_ptr);
@@ -306,6 +306,8 @@ void PYTHON_OT_wrapper(wmOperatorType *ot, void *userdata)
if (py_ret) {
Py_DECREF(py_ret);
} else {
+ fprintf(stderr, "BPy Operator \"%s\" registration error: %s item %d could not run\n", ot->idname, PYOP_ATTR_PROP, i);
+ PyLineSpit();
PyErr_Print();
PyErr_Clear();
}