summaryrefslogtreecommitdiffstats
path: root/Modules/_lsprof.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_lsprof.c')
-rw-r--r--Modules/_lsprof.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
index 66e534f..d3ed758 100644
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -762,7 +762,6 @@ profiler_dealloc(ProfilerObject *op)
static int
profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw)
{
- PyObject *o;
PyObject *timer = NULL;
double timeunit = 0.0;
int subcalls = 1;
@@ -777,11 +776,9 @@ profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw)
if (setSubcalls(pObj, subcalls) < 0 || setBuiltins(pObj, builtins) < 0)
return -1;
- o = pObj->externalTimer;
- pObj->externalTimer = timer;
- Py_XINCREF(timer);
- Py_XDECREF(o);
pObj->externalTimerUnit = timeunit;
+ Py_XINCREF(timer);
+ Py_SETREF(pObj->externalTimer, timer);
return 0;
}