PyAPI: add utilities PyTuple_SET_ITEMS, Py_INCREF_RET

Setting all values of a tuple is such a common operation that it deserves its own macro.
Also added Py_INCREF_RET to avoid confusing use of comma operator.
This commit is contained in:
2015-01-06 16:42:22 +11:00
parent ee58d44945
commit 9fd569a654
27 changed files with 253 additions and 118 deletions

View File

@@ -50,6 +50,7 @@
#include "BKE_global.h"
#include "../generic/py_capi_utils.h"
#include "../generic/python_utildefines.h"
#ifdef BUILD_DATE
extern char build_date[];
@@ -264,8 +265,7 @@ static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(cl
}
}
Py_INCREF(bpy_pydriver_Dict);
return bpy_pydriver_Dict;
return Py_INCREF_RET(bpy_pydriver_Dict);
}
static PyObject *bpy_app_autoexec_fail_message_get(PyObject *UNUSED(self), void *UNUSED(closure))