From 789dc0a3b74ec8fd008e4e51b9c06fbdf83fd8f7 Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Mon, 20 Feb 2017 18:02:35 +0100 Subject: [PATCH] python: type of initial_button_state must match format string --- modules/python/src2/cv2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp index 66e3733cec..43549cbe33 100644 --- a/modules/python/src2/cv2.cpp +++ b/modules/python/src2/cv2.cpp @@ -1362,7 +1362,7 @@ static PyObject *pycvCreateButton(PyObject*, PyObject *args, PyObject *kw) PyObject *userdata = NULL; char* button_name; int button_type = 0; - bool initial_button_state = false; + int initial_button_state = 0; if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|Oii", (char**)keywords, &button_name, &on_change, &userdata, &button_type, &initial_button_state)) return NULL; @@ -1374,7 +1374,7 @@ static PyObject *pycvCreateButton(PyObject*, PyObject *args, PyObject *kw) userdata = Py_None; } - ERRWRAP2(createButton(button_name, OnButtonChange, Py_BuildValue("OO", on_change, userdata), button_type, initial_button_state)); + ERRWRAP2(createButton(button_name, OnButtonChange, Py_BuildValue("OO", on_change, userdata), button_type, initial_button_state != 0)); Py_RETURN_NONE; } #endif