summaryrefslogtreecommitdiff
path: root/coverage/tracer.c
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-10-10 15:36:31 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-10-10 15:36:31 -0400
commit5b3e061e84857872572ec858efe51106ea156bdf (patch)
treebacc9b5d62d8e22212c557440be64224bb70f937 /coverage/tracer.c
parent5961c33f9212c831d2a0ab16c119856d67287ab6 (diff)
downloadpython-coveragepy-git-5b3e061e84857872572ec858efe51106ea156bdf.tar.gz
Properly separate the line data and the arc data.
Diffstat (limited to 'coverage/tracer.c')
-rw-r--r--coverage/tracer.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/coverage/tracer.c b/coverage/tracer.c
index c318e9ed..98f10d1b 100644
--- a/coverage/tracer.c
+++ b/coverage/tracer.c
@@ -39,7 +39,8 @@
typedef struct {
PyObject_HEAD
PyObject * should_trace;
- PyObject * data;
+ PyObject * line_data;
+ PyObject * arc_data;
PyObject * should_trace_cache;
PyObject * branch;
int started;
@@ -59,7 +60,8 @@ static int
Tracer_init(Tracer *self, PyObject *args, PyObject *kwds)
{
self->should_trace = NULL;
- self->data = NULL;
+ self->line_data = NULL;
+ self->arc_data = NULL;
self->should_trace_cache = NULL;
self->started = 0;
self->depth = -1;
@@ -80,7 +82,8 @@ Tracer_dealloc(Tracer *self)
}
Py_XDECREF(self->should_trace);
- Py_XDECREF(self->data);
+ Py_XDECREF(self->line_data);
+ Py_XDECREF(self->arc_data);
Py_XDECREF(self->should_trace_cache);
while (self->depth >= 0) {
@@ -245,7 +248,7 @@ Tracer_trace(Tracer *self, PyFrameObject *frame, int what, PyObject *arg)
Py_INCREF(tracename);
PyTuple_SET_ITEM(t, 0, tracename);
PyTuple_SET_ITEM(t, 1, MyInt_FromLong(frame->f_lineno));
- PyDict_SetItem(self->data, t, Py_None);
+ PyDict_SetItem(self->line_data, t, Py_None);
Py_DECREF(t);
}
}
@@ -296,7 +299,10 @@ Tracer_members[] = {
{ "should_trace", T_OBJECT, offsetof(Tracer, should_trace), 0,
PyDoc_STR("Function indicating whether to trace a file.") },
- { "data", T_OBJECT, offsetof(Tracer, data), 0,
+ { "line_data", T_OBJECT, offsetof(Tracer, line_data), 0,
+ PyDoc_STR("The raw dictionary of trace data.") },
+
+ { "arc_data", T_OBJECT, offsetof(Tracer, arc_data), 0,
PyDoc_STR("The raw dictionary of trace data.") },
{ "should_trace_cache", T_OBJECT, offsetof(Tracer, should_trace_cache), 0,