char *path=NULL;
static char *kwlist[] = {"flags", "path", NULL};
- if (! PyArg_ParseTupleAndKeywords(args, keywds, "|is", kwlist,
+ if (! PyArg_ParseTupleAndKeywords(args, keywds, "|iz", kwlist,
&flags, &path))
return 1;
PyErr_SetString(PyExc_ValueError, "Invalid value for whence");
}
- if (result)
- Py_DECREF(result);
+ Py_XDECREF(result);
if (PyErr_Occurred())
return NULL;
Py_RETURN_NONE;
Py_ssize_t dict_size;
dict = PyObject_CallMethod(self, "get_next", "");
+ if (PyErr_Occurred())
+ return NULL;
dict_size = PyDict_Size(dict);
if ((int64_t) dict_size > 0LL) {
return dict;
}
}
-#ifdef SD_JOURNAL_FOREACH_UNIQUE
PyDoc_STRVAR(Journal_query_unique__doc__,
"query_unique(field) -> a set of values\n\n"
"Returns a set of unique values in journal for given `field`.\n"
Py_DECREF(key);
return value_set;
}
-#endif //def SD_JOURNAL_FOREACH_UNIQUE
static PyObject *
Journal_get_data_threshold(Journal *self, void *closure)
Journal_wait__doc__},
{"seek_cursor", (PyCFunction)Journal_seek_cursor, METH_VARARGS,
Journal_seek_cursor__doc__},
-#ifdef SD_JOURNAL_FOREACH_UNIQUE
{"query_unique", (PyCFunction)Journal_query_unique, METH_VARARGS,
Journal_query_unique__doc__},
-#endif
{NULL} /* Sentinel */
};
static PyTypeObject JournalType = {
PyVarObject_HEAD_INIT(NULL, 0)
- "_reader.Journal", /*tp_name*/
+ "_reader._Journal", /*tp_name*/
sizeof(Journal), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)Journal_dealloc, /*tp_dealloc*/