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:
Oxicid
2025-09-22 15:20:17 +02:00
committed by Pratik Borhade
parent 3ccdd28458
commit 3dffbb7e35
2 changed files with 4 additions and 4 deletions

View File

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

View File

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