bpy consistency fix handler_add(handle)
This doesn't change the API, so it doesn't affect any script. However it give more consistent error messages.
This commit is contained in:
@@ -189,7 +189,7 @@ PyObject *pyrna_callback_classmethod_add(PyObject *UNUSED(self), PyObject *args)
|
||||
StructRNA *srna;
|
||||
|
||||
if (PyTuple_GET_SIZE(args) < 2) {
|
||||
PyErr_SetString(PyExc_ValueError, "handler_add(handle): expected at least 2 args");
|
||||
PyErr_SetString(PyExc_ValueError, "handler_add(handler): expected at least 2 args");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ PyObject *pyrna_callback_classmethod_remove(PyObject *UNUSED(self), PyObject *ar
|
||||
int cb_regiontype;
|
||||
|
||||
if (PyTuple_GET_SIZE(args) < 2) {
|
||||
PyErr_SetString(PyExc_ValueError, "callback_remove(handle): expected at least 2 args");
|
||||
PyErr_SetString(PyExc_ValueError, "callback_remove(handler): expected at least 2 args");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ PyObject *pyrna_callback_classmethod_remove(PyObject *UNUSED(self), PyObject *ar
|
||||
py_handle = PyTuple_GET_ITEM(args, 1);
|
||||
handle = PyCapsule_GetPointer(py_handle, RNA_CAPSULE_ID);
|
||||
if (handle == NULL) {
|
||||
PyErr_SetString(PyExc_ValueError, "callback_remove(handle): NULL handle given, invalid or already removed");
|
||||
PyErr_SetString(PyExc_ValueError, "callback_remove(handler): NULL handler given, invalid or already removed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user