summaryrefslogtreecommitdiff
path: root/coverage/tracer.c
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-02-18 22:22:38 -0500
committerNed Batchelder <ned@nedbatchelder.com>2015-02-18 22:22:38 -0500
commitdbd36c4ea1b2c20a74ebcd77ae287bd559a30c5f (patch)
tree45a98efc6c56a40c6c05eb9e80df8140068a2a50 /coverage/tracer.c
parentec82227213ac419d294f9f5019e9b94e81a71972 (diff)
downloadpython-coveragepy-git-dbd36c4ea1b2c20a74ebcd77ae287bd559a30c5f.tar.gz
Make branch=True get along with plugins.
Diffstat (limited to 'coverage/tracer.c')
-rw-r--r--coverage/tracer.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/coverage/tracer.c b/coverage/tracer.c
index 43ecd188..8577afc7 100644
--- a/coverage/tracer.c
+++ b/coverage/tracer.c
@@ -638,31 +638,30 @@ CTracer_handle_line(CTracer *self, PyFrameObject *frame)
}
if (lineno_from != -1) {
- if (self->tracing_arcs) {
- /* Tracing arcs: key is (last_line,this_line). */
- /* TODO: this needs to deal with lineno_to also. */
- if (CTracer_record_pair(self, self->cur_entry.last_line, lineno_from) < 0) {
- goto error;
+ for (; lineno_from <= lineno_to; lineno_from++) {
+ if (self->tracing_arcs) {
+ /* Tracing arcs: key is (last_line,this_line). */
+ if (CTracer_record_pair(self, self->cur_entry.last_line, lineno_from) < 0) {
+ goto error;
+ }
}
- }
- else {
- /* Tracing lines: key is simply this_line. */
- while (lineno_from <= lineno_to) {
+ else {
+ /* Tracing lines: key is simply this_line. */
PyObject * this_line = MyInt_FromInt(lineno_from);
if (this_line == NULL) {
goto error;
}
+
ret = PyDict_SetItem(self->cur_entry.file_data, this_line, Py_None);
Py_DECREF(this_line);
if (ret < 0) {
goto error;
}
- lineno_from++;
}
+
+ self->cur_entry.last_line = lineno_from;
}
}
-
- self->cur_entry.last_line = lineno_to;
}
}