From 3dffbb7e3537e76a94b7b26afed141d2110a3b6f Mon Sep 17 00:00:00 2001 From: Oxicid Date: Mon, 22 Sep 2025 15:20:17 +0200 Subject: [PATCH] Cleanup: correct misleading PyError message formatting Removed duplicated "Error" in `PyErr_SetString` messages Pull Request: https://projects.blender.org/blender/blender/pulls/146473 --- source/blender/python/generic/idprop_py_ui_api.cc | 6 +++--- source/blender/python/intern/bpy_app_timers.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/python/generic/idprop_py_ui_api.cc b/source/blender/python/generic/idprop_py_ui_api.cc index 74950fd858c..d42a23391f2 100644 --- a/source/blender/python/generic/idprop_py_ui_api.cc +++ b/source/blender/python/generic/idprop_py_ui_api.cc @@ -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; } diff --git a/source/blender/python/intern/bpy_app_timers.cc b/source/blender/python/intern/bpy_app_timers.cc index cd469811d40..512e19fceea 100644 --- a/source/blender/python/intern/bpy_app_timers.cc +++ b/source/blender/python/intern/bpy_app_timers.cc @@ -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;