if (ri->stop)
return;
- if (!ri->func)
+ if (ri->func == Py_None)
key_moan(file, line, msg, 0);
else if ((res = PyObject_CallFunction(ri->func, "sis",
file, line, msg)) == 0)
static PyObject *keyfile_pynew(PyTypeObject *ty,
PyObject *arg, PyObject *kw)
{
- struct reportinfo ri = { 0, 0 };
+ struct reportinfo ri = { Py_None, 0 };
char *file = 0;
unsigned how = KOPEN_READ;
keyfile_pyobj *rc = 0;
if (!PyArg_ParseTupleAndKeywords(arg, kw, "s|iO:new", KWLIST,
&file, &how, &ri.func))
goto end;
- if (ri.func && !PyCallable_Check(ri.func))
+ if (ri.func != Py_None && !PyCallable_Check(ri.func))
TYERR("reporter function not callable");
if ((rc = (keyfile_pyobj *)ty->tp_alloc(ty, 0)) == 0)
goto end;
static PyObject *kfmeth_merge(PyObject *me, PyObject *arg, PyObject *kw)
{
- struct reportinfo ri = { 0, 0 };
+ struct reportinfo ri = { Py_None, 0 };
char *name;
PyObject *x = 0;
FILE *fp = 0;
if (!PyArg_ParseTupleAndKeywords(arg, kw, "O!|O:merge", KWLIST,
&PyFile_Type, &x, &ri.func))
goto end;
- if (ri.func && !PyCallable_Check(ri.func))
+ if (ri.func != Py_None && !PyCallable_Check(ri.func))
TYERR("reporter function not callable");
if ((fp = PyFile_AsFile(x)) == 0)
goto end;