summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/parser.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/coverage/parser.py b/coverage/parser.py
index 4890aa6f..ee07c20c 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -195,11 +195,18 @@ class CodeParser(object):
return sorted(all_arcs)
def exit_counts(self):
- """Return a dict mapping line numbers to number of exits from that line."""
+ """Get a mapping from line numbers to count of exits from that line.
+
+ Excluded lines are excluded.
+
+ """
+ excluded_lines = self.first_lines(self.excluded)
exit_counts = {}
for l1,l2 in self.arcs():
if l1 == -1:
continue
+ if l1 in excluded_lines:
+ continue
if l1 not in exit_counts:
exit_counts[l1] = 0
exit_counts[l1] += 1