Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-01-17 00:46:36 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-17 00:46:36 +0300
commitdfb63653f4f084ec8c8b061dd0f33769b16b3b91 (patch)
treeefe68b1193340880e818f8f217202298c3e57c79 /source/blender/python
parent9bfc9d799e08b467e94c3d750a9c8b2909a72e3e (diff)
PyAPI: minor change to bpy.app.debug_value exception handling
Use error from int conversion function.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_app.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 01c8573f589..fe8eb768b3a 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -306,20 +306,16 @@ static PyObject *bpy_app_debug_value_get(PyObject *UNUSED(self), void *UNUSED(cl
static int bpy_app_debug_value_set(PyObject *UNUSED(self), PyObject *value, void *UNUSED(closure))
{
- int param = PyC_Long_AsI32(value);
+ short param = PyC_Long_AsI16(value);
if (param == -1 && PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError, "bpy.app.debug_value can only be set to a whole number");
+ PyC_Err_SetString_Prefix(
+ PyExc_TypeError,
+ "bpy.app.debug_value can only be set to a whole number");
return -1;
}
- if (param < SHRT_MIN || param > SHRT_MAX) {
- PyErr_SetString(PyExc_ValueError,
- "bpy.app.debug_value can only be set to short range [-32768, 32767]");
- return -1;
- }
-
- G.debug_value = (short)param;
+ G.debug_value = param;
WM_main_add_notifier(NC_WINDOW, NULL);