diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-17 20:22:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-17 20:22:39 +0300 |
commit | 3c2d59e032ee8d203f3fa06afe8809d0dfecefd8 (patch) | |
tree | 468fa408de9d1c80bba77efe0dfc922a3f63a75b /source/blender | |
parent | 780aa24dfea09137175d44d50f50f5c118f13ac2 (diff) |
py/rna api property api functions crashed with empty args.
eg: bpy.props.BoolProperty()
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 07f7dfc0d09..7355fa2a0c9 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -103,8 +103,8 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_GET_SIZE(args) > 0) { - PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) { + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); return NULL; } @@ -163,8 +163,8 @@ PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_GET_SIZE(args) > 0) { - PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) { + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); return NULL; } @@ -234,8 +234,8 @@ PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_GET_SIZE(args) > 0) { - PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) { + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); return NULL; } @@ -295,8 +295,8 @@ PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_GET_SIZE(args) > 0) { - PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) { + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); return NULL; } @@ -370,8 +370,8 @@ PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_GET_SIZE(args) > 0) { - PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) { + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); return NULL; } @@ -439,8 +439,8 @@ PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_GET_SIZE(args) > 0) { - PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) { + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); return NULL; } @@ -511,8 +511,8 @@ PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_GET_SIZE(args) > 0) { - PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) { + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); return NULL; } @@ -617,8 +617,8 @@ PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_GET_SIZE(args) > 0) { - PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) { + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); return NULL; } @@ -692,8 +692,8 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_GET_SIZE(args) > 0) { - PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) { + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); return NULL; } @@ -747,8 +747,8 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; - if (PyTuple_GET_SIZE(args) > 0) { - PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + if (PyTuple_GET_SIZE(args) > 0 || kw==NULL) { + PyErr_SetString(PyExc_ValueError, "all args must be keywords"); return NULL; } |