X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/7c12c1089cfbee5b0a390d5f3de37f85de210263..b3056981450c5f45450afdfcf7e7671610611522:/lib/python/python.cpp diff --git a/lib/python/python.cpp b/lib/python/python.cpp index 9e7e5c21..a1ef1508 100644 --- a/lib/python/python.cpp +++ b/lib/python/python.cpp @@ -95,21 +95,23 @@ int ePython::execute(const std::string &pythonfile, const std::string &funcname) return 0; } -void ePython::call(PyObject *pFunc, PyObject *pArgs) +int ePython::call(PyObject *pFunc, PyObject *pArgs) { + int res = -1; PyObject *pValue; if (pFunc && PyCallable_Check(pFunc)) { pValue = PyObject_CallObject(pFunc, pArgs); if (pValue != NULL) { - printf("Result of call: %ld\n", PyInt_AsLong(pValue)); + res = PyInt_AsLong(pValue); Py_DECREF(pValue); } else { PyErr_Print(); } } + return res; } PyObject *ePython::resolve(const std::string &pythonfile, const std::string &funcname)