diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-09 10:06:37 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-09 10:06:37 +0400 |
commit | ced3f3ad15a6786631fa4987d0da63025ddb1c60 (patch) | |
tree | 72fa93def3ec947363a6dbaca86d78ae49dc5a84 /source | |
parent | f4be9a6393e76f1dc40488ab25c43763af2edcc2 (diff) |
- fix for using ['prop'] in RNA api
- fix for testing without USE_PY_METACLASS defined.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 4205a9618d3..9c4ab59d827 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -532,7 +532,7 @@ int RNA_struct_is_a(StructRNA *type, StructRNA *srna) PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier) { - if(identifier[0]=='[' && identifier[1]=='"') { // " (dummy comment to avoid confusing some function lists in text editors) + if(identifier[0]=='[' && ELEM(identifier[1], '"', '\'')) { // " (dummy comment to avoid confusing some function lists in text editors) /* id prop lookup, not so common */ PropertyRNA *r_prop= NULL; PointerRNA r_ptr; /* only support single level props */ diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 9ac9ae14cd1..3d8eb04093f 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -123,7 +123,7 @@ static PyObject *bpy_prop_deferred_return(PyObject *func, PyObject *kw) PyErr_SetString(PyExc_ValueError, "all args must be keywords"); \ return NULL; \ } \ - srna= srna_from_self(self, "##_func(...):"); \ + srna= srna_from_self(self, #_func"(...):"); \ if(srna==NULL) { \ if(PyErr_Occurred()) \ return NULL; \ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 46e02117e77..f5e8e0e7b4e 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -4276,8 +4276,8 @@ static PyObject* pyrna_srna_ExternalType(StructRNA *srna) fprintf(stderr, "pyrna_srna_ExternalType: failed to find 'bpy_types' module\n"); return NULL; } -#ifdef USE_PY_METACLASS bpy_types_dict = PyModule_GetDict(bpy_types); // borrow +#ifdef USE_PY_METACLASS bpy_types_rna_meta_base = PyDict_GetItemString(bpy_types_dict, BPY_SRNA_IDPROP_META); #endif Py_DECREF(bpy_types); // fairly safe to assume the dict is kept @@ -4353,7 +4353,7 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna) metaclass= bpy_types_rna_meta_base; } #else - if(RNA_struct_idprops_check(srna) && !PyObject_IsSubclass(py_base, &pyrna_struct_meta_idprop_Type)) { + if(RNA_struct_idprops_check(srna) && !PyObject_IsSubclass(py_base, (PyObject *)&pyrna_struct_meta_idprop_Type)) { metaclass= (PyObject *)&pyrna_struct_meta_idprop_Type; } #endif |