diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-08-16 21:51:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-08-16 21:51:50 +0300 |
commit | e8ffe25eb11183bc8a6c1c53e20147b22ed17d2a (patch) | |
tree | c7d5620ed035decdaba347c436906f9fd50f74c4 /source/blender | |
parent | fdcae9ed0c78eb9e5e01f121256329e8b45d727b (diff) |
PyRNA: include class name in double-register exception
Helps debugging errors when classes are registered twice.
Diffstat (limited to 'source/blender')
-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 9a8d8c5ec21..e7fed02fe79 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -8557,9 +8557,10 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class } if (PyDict_GetItem(((PyTypeObject *)py_class)->tp_dict, bpy_intern_str_bl_rna)) { - PyErr_SetString(PyExc_ValueError, - "register_class(...): " - "already registered as a subclass"); + PyErr_Format(PyExc_ValueError, + "register_class(...): " + "already registered as a subclass '%.200s'", + ((PyTypeObject *)py_class)->tp_name); return NULL; } |