PyRNA: include class name in double-register exception

Helps debugging errors when classes are registered twice.
This commit is contained in:
Campbell Barton 2019-08-17 04:51:50 +10:00
parent fdcae9ed0c
commit e8ffe25eb1
Notes: blender-bot 2023-02-14 01:53:55 +01:00
Referenced by issue #68867, Lookdev HDRIs are never unloaded, a sort of memory leak (+ other HDRI issues)
Referenced by issue #66689, Viewport isn't updating Children hair particle on particle edit
1 changed files with 4 additions and 3 deletions

View File

@ -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;
}