Skip to content

Commit 789dc0a

Browse files
committed
python: type of initial_button_state must match format string
1 parent df86f07 commit 789dc0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/python/src2/cv2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ static PyObject *pycvCreateButton(PyObject*, PyObject *args, PyObject *kw)
13621362
PyObject *userdata = NULL;
13631363
char* button_name;
13641364
int button_type = 0;
1365-
bool initial_button_state = false;
1365+
int initial_button_state = 0;
13661366

13671367
if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|Oii", (char**)keywords, &button_name, &on_change, &userdata, &button_type, &initial_button_state))
13681368
return NULL;
@@ -1374,7 +1374,7 @@ static PyObject *pycvCreateButton(PyObject*, PyObject *args, PyObject *kw)
13741374
userdata = Py_None;
13751375
}
13761376

1377-
ERRWRAP2(createButton(button_name, OnButtonChange, Py_BuildValue("OO", on_change, userdata), button_type, initial_button_state));
1377+
ERRWRAP2(createButton(button_name, OnButtonChange, Py_BuildValue("OO", on_change, userdata), button_type, initial_button_state != 0));
13781378
Py_RETURN_NONE;
13791379
}
13801380
#endif

0 commit comments

Comments
 (0)