Commit bb209193 authored by Gabe Schwartz's avatar Gabe Schwartz

Updated usage of METH_X definitions for python 3.

Python 3 requires METH_VARARGS | METH_KEYWORDS, not just METH_KEYWORDS.
parent bce1b352
......@@ -1196,7 +1196,7 @@ static PyMethodDef methods[] = {
#include "pyopencv_generated_func_tab.h"
{"createTrackbar", pycvCreateTrackbar, METH_VARARGS, "createTrackbar(trackbarName, windowName, value, count, onChange) -> None"},
{"setMouseCallback", (PyCFunction)pycvSetMouseCallback, METH_KEYWORDS, "setMouseCallback(windowName, onMouse [, param]) -> None"},
{"setMouseCallback", (PyCFunction)pycvSetMouseCallback, METH_VARARGS | METH_KEYWORDS, "setMouseCallback(windowName, onMouse [, param]) -> None"},
{NULL, NULL},
};
......
......@@ -543,7 +543,7 @@ class FuncInfo(object):
p2 = s.rfind(")")
docstring_list = [s[:p1+1] + "[" + s[p1+1:p2] + "]" + s[p2:]]
return Template(' {"$py_funcname", (PyCFunction)$wrap_funcname, METH_KEYWORDS, "$py_docstring"},\n'
return Template(' {"$py_funcname", (PyCFunction)$wrap_funcname, METH_VARARGS | METH_KEYWORDS, "$py_docstring"},\n'
).substitute(py_funcname = self.variants[0].wname, wrap_funcname=self.get_wrapper_name(),
py_docstring = " or ".join(docstring_list))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment