returning NULL causes the interpreter to raise a SystemError.
Noted by Anthony Baxter at Python 10.
PyObject *result = NULL;
if (PyArg_ParseTuple(args, ":start")) {
- if (is_available(self))
+ if (is_available(self)) {
do_start(self);
+ result = Py_None;
+ Py_INCREF(result);
+ }
}
return result;
}
if (PyArg_ParseTuple(args, ":stop")) {
if (!self->active)
PyErr_SetString(ProfilerError, "profiler not active");
- else
+ else {
do_stop(self);
+ result = Py_None;
+ Py_INCREF(result);
+ }
}
return result;
}