diff options
Diffstat (limited to 'source/blender/python/intern/bpy_rna.c')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index a3ded8813ac..cc981c7c2e1 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -9010,11 +9010,12 @@ void pyrna_struct_type_extend_capi(struct StructRNA *srna, py_method = PyClassMethod_New(cfunc); Py_DECREF(cfunc); } - else { - /* Currently only static and class methods are used. */ - BLI_assert(method->ml_flags & METH_STATIC); + else if (method->ml_flags & METH_STATIC) { py_method = PyCFunction_New(method, NULL); } + else { + py_method = PyDescr_NewMethod(type, method); + } const int err = PyDict_SetItemString(dict, method->ml_name, py_method); Py_DECREF(py_method); |