diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-07-01 01:59:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-07-01 01:59:21 +0400 |
commit | 5403edf8ff266fc8829525b5784c53598f8c4e0f (patch) | |
tree | bb7aede56efa4ffec2ecd790dd3ab738ce98b902 | |
parent | 60c2599a1a5990c66eb8e7c4d9d9959526a3cc2d (diff) |
disabling foreach_get/set for python2.x, since it uses new buffer api.
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 53f7f532b8b..e13f02c5529 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1225,6 +1225,7 @@ static PyObject *pyrna_prop_values(BPy_PropertyRNA *self) return ret; } +#if (PY_VERSION_HEX >= 0x03000000) /* foreach needs py3 */ static void foreach_attr_type( BPy_PropertyRNA *self, char *attr, /* values to assign */ RawPropertyType *raw_type, int *attr_tot, int *attr_signed ) @@ -1457,7 +1458,7 @@ static PyObject *pyrna_prop_foreach_set(BPy_PropertyRNA *self, PyObject *args) { return foreach_getset(self, args, 1); } - +#endif /* #if (PY_VERSION_HEX >= 0x03000000) */ /* A bit of a kludge, make a list out of a collection or array, * then return the lists iter function, not especially fast but convenient for now */ @@ -1502,9 +1503,11 @@ static struct PyMethodDef pyrna_prop_methods[] = { {"items", (PyCFunction)pyrna_prop_items, METH_NOARGS,NULL}, {"values", (PyCFunction)pyrna_prop_values, METH_NOARGS, NULL}, +#if (PY_VERSION_HEX >= 0x03000000) /* array accessor function */ {"foreach_get", (PyCFunction)pyrna_prop_foreach_get, METH_VARARGS, NULL}, {"foreach_set", (PyCFunction)pyrna_prop_foreach_set, METH_VARARGS, NULL}, +#endif {NULL, NULL, 0, NULL} }; |