diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-20 08:44:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-20 08:49:10 +0300 |
commit | 46cf33bf0146946ed05756a9b8bfa1318538f020 (patch) | |
tree | 951f8a09224e7c0c591cd7befdc99788e52a175d /source/blender/python/intern/bpy_rna_array.c | |
parent | a10a7f42de29d251e27f6b85e7f3cac26e6843ed (diff) |
PyAPI: Make use of PyC_LongAs... API
Avoids setting exceptions inline,
also use Matrix_ParseAny for bmesh.ops.
Some inline exceptions are kept because they show useful details.
Diffstat (limited to 'source/blender/python/intern/bpy_rna_array.c')
-rw-r--r-- | source/blender/python/intern/bpy_rna_array.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index 38931cd85de..3e147d29c90 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -38,6 +38,8 @@ #include "RNA_access.h" +#include "../generic/py_capi_utils.h" + #define USE_MATHUTILS #ifdef USE_MATHUTILS @@ -550,7 +552,7 @@ static void py_to_float(const struct ItemConvertArgData *arg, PyObject *py, char static void py_to_int(const struct ItemConvertArgData *arg, PyObject *py, char *data) { const int *range = arg->int_data.range; - int value = (int)PyLong_AsLong(py); + int value = PyC_Long_AsI32(py); CLAMP(value, range[0], range[1]); *(int *)data = value; } |