[issue36562] Can't call a method from a module built in Python C API

2019-04-08 Thread Joao Paulo
Joao Paulo added the comment: The following modifications solved the problem: static PyMethodDef pyModuleMethods[] = { { "runTester", (PyCFunction)runTesterFunc, METH_VARARGS | METH_KEYWORDS, "Foo Boo." }, { NULL, NULL, 0, NULL } }; static struct PyModuleDef MyModule = {

[issue36562] Can't call a method from a module built in Python C API

2019-04-08 Thread Joao Paulo
New submission from Joao Paulo : I'm trying to build a python module in C++ using the Python C API and the code is attached. The problem is when I run my_module.runTester() in PyRun_SimpleString. I get the following error message: SystemError: Bad call flags in PyCFunction_Call.