summaryrefslogtreecommitdiff
path: root/coverage/parser.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-01-02 16:14:35 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-01-02 16:14:35 -0500
commit255afeb3314da3ad388ac7a3330dd3f94eae0d99 (patch)
treec956ed49d788f8ea541cb1d0e63b724c0c6a548e /coverage/parser.py
parent9c5e1a70c52da251e357d05218213c750c1e9a8d (diff)
downloadpython-coveragepy-255afeb3314da3ad388ac7a3330dd3f94eae0d99.tar.gz
Support returning through a finally
Diffstat (limited to 'coverage/parser.py')
-rw-r--r--coverage/parser.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/coverage/parser.py b/coverage/parser.py
index 44cb155..d85f0b5 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -426,8 +426,6 @@ class AstArcAnalyzer(object):
# TODO: listcomps hidden in lists: x = [[i for i in range(10)]]
# TODO: multi-line listcomps
# TODO: nested function definitions
- # TODO: multiple `except` clauses
- # TODO: return->finally
def process_break_exits(self, exits):
for block in self.blocks():
@@ -467,8 +465,10 @@ class AstArcAnalyzer(object):
def process_return_exits(self, exits):
for block in self.blocks():
- # TODO: need a check here for TryBlock
- if isinstance(block, FunctionBlock):
+ if isinstance(block, TryBlock) and block.final_start:
+ block.return_from.update(exits)
+ break
+ elif isinstance(block, FunctionBlock):
# TODO: what if there is no enclosing function?
for exit in exits:
self.arcs.add((exit, -block.start))