From cd83e41d7ee0eb2e48c8340539213f3bdee49239 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 29 Jan 2016 10:41:37 -0500 Subject: How to flag uncaught exception branches --- coverage/parser.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'coverage/parser.py') diff --git a/coverage/parser.py b/coverage/parser.py index 1a2ff5f8..27c17438 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -668,6 +668,11 @@ class AstArcAnalyzer(object): self.process_raise_exits(exits) if try_block.return_from: self.process_return_exits(exits) + else: + # No final body: if there is an `except` handler without a + # catch-all, then exceptions can raise from there. + if last_handler_start is not None: + self.process_raise_exits([last_handler_start]) return exits -- cgit v1.2.1