diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-06 08:42:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-06 11:09:11 +0300 |
commit | 9fd569a654ded46901c7f20c5fe080972cbb10d2 (patch) | |
tree | 933b893aeaa0a8bffe230933523512340dfa016d /source/blender/python/mathutils/mathutils.c | |
parent | ee58d449455df9470c4a0a902056b8c2001128bf (diff) |
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.
Diffstat (limited to 'source/blender/python/mathutils/mathutils.c')
-rw-r--r-- | source/blender/python/mathutils/mathutils.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c index 0a550105124..6fe8dc3866b 100644 --- a/source/blender/python/mathutils/mathutils.c +++ b/source/blender/python/mathutils/mathutils.c @@ -31,6 +31,8 @@ #include "BLI_math.h" #include "BLI_utildefines.h" +#include "../generic/python_utildefines.h" + #ifndef MATH_STANDALONE # include "BLI_dynstr.h" #endif @@ -444,8 +446,7 @@ char BaseMathObject_owner_doc[] = "The item this is wrapping or None (read-only PyObject *BaseMathObject_owner_get(BaseMathObject *self, void *UNUSED(closure)) { PyObject *ret = self->cb_user ? self->cb_user : Py_None; - Py_INCREF(ret); - return ret; + return Py_INCREF_RET(ret); } char BaseMathObject_is_wrapped_doc[] = "True when this object wraps external data (read-only).\n\n:type: boolean"; |