Cleanup: correct misleading PyError message formatting
Removed duplicated "Error" in `PyErr_SetString` messages Pull Request: https://projects.blender.org/blender/blender/pulls/146473
This commit is contained in:
@@ -195,7 +195,7 @@ static bool idprop_ui_data_update_int_default(IDProperty *idprop,
|
||||
else {
|
||||
const int value = PyC_Long_AsI32(default_value);
|
||||
if ((value == -1) && PyErr_Occurred()) {
|
||||
PyErr_SetString(PyExc_ValueError, "Error converting \"default\" argument to integer");
|
||||
PyErr_SetString(PyExc_ValueError, "Cannot convert \"default\" argument to integer");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ static bool idprop_ui_data_update_bool_default(IDProperty *idprop,
|
||||
else {
|
||||
const int value = PyC_Long_AsBool(default_value);
|
||||
if ((value == -1) && PyErr_Occurred()) {
|
||||
PyErr_SetString(PyExc_ValueError, "Error converting \"default\" argument to integer");
|
||||
PyErr_SetString(PyExc_ValueError, "Cannot convert \"default\" argument to integer");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ static bool idprop_ui_data_update_float_default(IDProperty *idprop,
|
||||
else {
|
||||
const double value = PyFloat_AsDouble(default_value);
|
||||
if ((value == -1.0) && PyErr_Occurred()) {
|
||||
PyErr_SetString(PyExc_ValueError, "Error converting \"default\" argument to double");
|
||||
PyErr_SetString(PyExc_ValueError, "Cannot convert \"default\" argument to double");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ PyDoc_STRVAR(
|
||||
static PyObject *bpy_app_timers_unregister(PyObject * /*self*/, PyObject *function)
|
||||
{
|
||||
if (!BLI_timer_unregister(intptr_t(function))) {
|
||||
PyErr_SetString(PyExc_ValueError, "Error: function is not registered");
|
||||
PyErr_SetString(PyExc_ValueError, "function is not registered");
|
||||
return nullptr;
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
|
||||
Reference in New Issue
Block a user