[Python-checkins] CVS: python/dist/src/Modules _hotshot.c,1.12,1.13
Fred L. Drake
fdrake@users.sourceforge.net
Fri, 08 Feb 2002 13:27:52 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv26767/Modules
Modified Files:
_hotshot.c
Log Message:
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.
Index: _hotshot.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_hotshot.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** _hotshot.c 12 Jan 2002 11:05:04 -0000 1.12
--- _hotshot.c 8 Feb 2002 21:27:50 -0000 1.13
***************
*** 1181,1186 ****
if (PyArg_ParseTuple(args, ":start")) {
! if (is_available(self))
do_start(self);
}
return result;
--- 1181,1189 ----
if (PyArg_ParseTuple(args, ":start")) {
! if (is_available(self)) {
do_start(self);
+ result = Py_None;
+ Py_INCREF(result);
+ }
}
return result;
***************
*** 1199,1204 ****
if (!self->active)
PyErr_SetString(ProfilerError, "profiler not active");
! else
do_stop(self);
}
return result;
--- 1202,1210 ----
if (!self->active)
PyErr_SetString(ProfilerError, "profiler not active");
! else {
do_stop(self);
+ result = Py_None;
+ Py_INCREF(result);
+ }
}
return result;