diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-09-24 06:48:58 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-09-24 06:48:58 -0400 |
commit | 545a47cc59b88e5b51852256e6cc1602850d001b (patch) | |
tree | 5ea7e435ea483bd176937cf80f4b9b6c43d9e9fd /coverage/ctracer/tracer.c | |
parent | bd36f540f4ab9a7155da3993f5d7d48b10112900 (diff) | |
parent | b5d5aa99ebcfa140bc779301b22a0866903b6342 (diff) | |
download | python-coveragepy-git-545a47cc59b88e5b51852256e6cc1602850d001b.tar.gz |
Merge branch 'nedbat/dynamic-contexts'
Diffstat (limited to 'coverage/ctracer/tracer.c')
-rw-r--r-- | coverage/ctracer/tracer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/coverage/ctracer/tracer.c b/coverage/ctracer/tracer.c index 01f8b19b..7d639112 100644 --- a/coverage/ctracer/tracer.c +++ b/coverage/ctracer/tracer.c @@ -341,7 +341,6 @@ CTracer_handle_call(CTracer *self, PyFrameObject *frame) CFileDisposition * pdisp = NULL; STATS( self->stats.calls++; ) - self->activity = TRUE; /* Grow the stack. */ if (CTracer_set_pdata_stack(self) < 0) { @@ -353,7 +352,7 @@ CTracer_handle_call(CTracer *self, PyFrameObject *frame) self->pcur_entry = &self->pdata_stack->stack[self->pdata_stack->depth]; /* See if this frame begins a new context. */ - if (self->should_start_context && self->context == Py_None) { + if (self->should_start_context != Py_None && self->context == Py_None) { PyObject * context; /* We're looking for our context, ask should_start_context if this is the start. */ STATS( self->stats.start_context_calls++; ) @@ -866,6 +865,8 @@ CTracer_trace(CTracer *self, PyFrameObject *frame, int what, PyObject *arg_unuse goto error; } + self->activity = TRUE; + switch (what) { case PyTrace_CALL: if (CTracer_handle_call(self, frame) < 0) { |