Revision: 21276 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21276 Author: campbellbarton Date: 2009-06-30 23:59:21 +0200 (Tue, 30 Jun 2009)
Log Message: ----------- disabling foreach_get/set for python2.x, since it uses new buffer api. Modified Paths: -------------- branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c Modified: branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c =================================================================== --- branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c 2009-06-30 20:34:00 UTC (rev 21275) +++ branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c 2009-06-30 21:59:21 UTC (rev 21276) @@ -1225,6 +1225,7 @@ 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,8 +1458,8 @@ { 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 */ PyObject *pyrna_prop_iter(BPy_PropertyRNA *self) @@ -1502,9 +1503,11 @@ {"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} }; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs