summaryrefslogtreecommitdiff
path: root/coverage/parser.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-02-13 17:41:51 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-02-13 17:41:51 -0500
commit1816fad451ba00d669efba1211c136dbbef52c61 (patch)
tree67c4e12dab8242de74eb1751553b074a9723a451 /coverage/parser.py
parentff84e43cdb213454d57317db85fe426438c653ca (diff)
downloadpython-coveragepy-1816fad451ba00d669efba1211c136dbbef52c61.tar.gz
Add missing branch descriptions for handling exceptions
Diffstat (limited to 'coverage/parser.py')
-rw-r--r--coverage/parser.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/coverage/parser.py b/coverage/parser.py
index 715ab15..aa7693f 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -786,14 +786,15 @@ class AstArcAnalyzer(object):
handler_exits = set()
- last_handler_start = None
if node.handlers:
+ last_handler_start = None
for handler_node in node.handlers:
handler_start = self.line_for_node(handler_node)
if last_handler_start is not None:
self.arcs.add((last_handler_start, handler_start))
last_handler_start = handler_start
- handler_exits |= self.add_body_arcs(handler_node.body, from_start=ArcStart(handler_start))
+ from_start = ArcStart(handler_start, cause="the exception caught by line {lineno} didn't happen")
+ handler_exits |= self.add_body_arcs(handler_node.body, from_start=from_start)
if node.orelse:
exits = self.add_body_arcs(node.orelse, prev_starts=exits)