disabling foreach_get/set for python2.x, since it uses new buffer api.
This commit is contained in:
@@ -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}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user