diff options
author | Fred Drake <fdrake@acm.org> | 2002-02-08 21:31:23 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-02-08 21:31:23 (GMT) |
commit | 68726f5384167f33be42984510df83a8df82e149 (patch) | |
tree | 28fcee81f9c0472e48c9d2481a9896e69bb631f1 | |
parent | f217829fd440467903f32a37300a2e7b2c248a80 (diff) | |
download | cpython-68726f5384167f33be42984510df83a8df82e149.zip cpython-68726f5384167f33be42984510df83a8df82e149.tar.gz cpython-68726f5384167f33be42984510df83a8df82e149.tar.bz2 |
start() and stop() methods: return None where there is no exception;
returning NULL causes the interpreter to raise a SystemError.
Noted by Anthony Baxter at Python 10.
-rw-r--r-- | Modules/_hotshot.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c index ebaf37c..f88629d 100644 --- a/Modules/_hotshot.c +++ b/Modules/_hotshot.c @@ -1180,8 +1180,11 @@ profiler_start(ProfilerObject *self, PyObject *args) 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; } @@ -1198,8 +1201,11 @@ profiler_stop(ProfilerObject *self, PyObject *args) 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; } |