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:
@@ -44,6 +44,7 @@
|
||||
#include "bpy_rna.h" /* for setting arg props only - pyrna_py_to_prop() */
|
||||
#include "bpy_util.h"
|
||||
#include "../generic/bpy_internal_import.h"
|
||||
#include "../generic/python_utildefines.h"
|
||||
|
||||
#include "RNA_access.h"
|
||||
#include "RNA_enum_types.h"
|
||||
@@ -127,9 +128,8 @@ static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args)
|
||||
/* restore with original context dict, probably NULL but need this for nested operator calls */
|
||||
Py_XDECREF(context_dict);
|
||||
CTX_py_dict_set(C, (void *)context_dict_back);
|
||||
|
||||
Py_INCREF(ret);
|
||||
return ret;
|
||||
|
||||
return Py_INCREF_RET(ret);
|
||||
}
|
||||
|
||||
static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
|
||||
|
Reference in New Issue
Block a user