diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-11 02:08:25 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-11 02:26:27 +0300 |
commit | 27fb63381e9b0963976237c58ca2cfc9bc5ddfd8 (patch) | |
tree | 90570944912ac671dbfcb57c7af68c3f3ad8b0f6 /source/blender/python | |
parent | 4a8bd318255e6fe829a93e8cb8039e8e1896fc72 (diff) |
Fix T94121: PyAPI: ID property group returns wrong type with iter()
Regression in 265d97556aa0f0f2a0e4dd7584e3b8573bbddd54.
Where iterating directly on a property group failed, e.g.:
`iter(group)`, tests missed this since only `group.keys()`
was checked.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/generic/idprop_py_api.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index c05c003b176..2fbb6b8ee05 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -756,7 +756,16 @@ static int BPy_IDGroup_Map_SetItem(BPy_IDProperty *self, PyObject *key, PyObject static PyObject *BPy_IDGroup_iter(BPy_IDProperty *self) { - return BPy_IDGroup_ViewKeys_CreatePyObject(self); + PyObject *iterable = BPy_IDGroup_ViewKeys_CreatePyObject(self); + PyObject *ret; + if (iterable) { + ret = PyObject_GetIter(iterable); + Py_DECREF(iterable); + } + else { + ret = NULL; + } + return ret; } PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop) |