"The callback function will be called with two or three parameters:\n"
"timeout: Indicates that only data older than 'timeout' seconds is to\n"
" be flushed.\n"
- "id: Specifies which values are to be flushed.\n"
+ "id: Specifies which values are to be flushed. Might be None.\n"
"data: The optional data parameter passed to the register function.\n"
" If the parameter was omitted it will be omitted here, too.";
PyObject *ret, *text;
CPY_LOCK_THREADS
- text = cpy_string_to_unicode_or_bytes(id);
+ if (id) {
+ text = cpy_string_to_unicode_or_bytes(id);
+ } else {
+ text = Py_None;
+ Py_INCREF(text);
+ }
if (c->data == NULL)
ret = PyObject_CallFunction(c->callback, "iN", timeout, text); /* New reference. */
else