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>2015-08-04 11:34:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-08-04 11:49:42 +0300
commitcff288cf3a0d71b610fa20875a321ea3b8db2388 (patch)
tree32d172a1953c6f5777690e616a8581fd8801be53 /source/blender/python/intern/bpy.c
parent62c8f46ab6f16f99bcf848936a690e01f4c9e770 (diff)
Use PyC_ParseBool to parse bools
This could cause problems since they could be any int, then passed directly to internal functions that assume bools.
Diffstat (limited to 'source/blender/python/intern/bpy.c')
-rw-r--r--source/blender/python/intern/bpy.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index 9a5e488850e..fa2ad3a4803 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -114,13 +114,16 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec
int flag = 0;
PyObject *list;
- int absolute = false;
- int packed = false;
- int local = false;
+ bool absolute = false;
+ bool packed = false;
+ bool local = false;
static const char *kwlist[] = {"absolute", "packed", "local", NULL};
- if (!PyArg_ParseTupleAndKeywords(args, kw, "|iii:blend_paths",
- (char **)kwlist, &absolute, &packed, &local))
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kw, "|O&O&O&:blend_paths", (char **)kwlist,
+ PyC_ParseBool, &absolute,
+ PyC_ParseBool, &packed,
+ PyC_ParseBool, &local))
{
return NULL;
}