#include <lib/base/nconfig.h>
#include <lib/python/python.h>
-PyObject *ePythonConfigQuery::m_queryFunc;
+ePyObject ePythonConfigQuery::m_queryFunc;
-void ePythonConfigQuery::setQueryFunc(PyObject *queryFunc)
+void ePythonConfigQuery::setQueryFunc(ePyObject queryFunc)
{
if (m_queryFunc)
Py_DECREF(m_queryFunc);
{
if (key && PyCallable_Check(m_queryFunc))
{
- PyObject *pArgs = PyTuple_New(1);
+ ePyObject pArgs = PyTuple_New(1);
PyTuple_SET_ITEM(pArgs, 0, PyString_FromString(key));
- PyObject *pRet = PyObject_CallObject(m_queryFunc, pArgs);
+ ePyObject pRet = PyObject_CallObject(m_queryFunc, pArgs);
Py_DECREF(pArgs);
if (pRet)
{
if (PyString_Check(pRet))
{
value.assign(PyString_AS_STRING(pRet));
+ Py_DECREF(pRet);
return 0;
}
Py_DECREF(pRet);