From 12e05dbdbedea2c668ce90cb19da34476dccaca8 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 27 May 2014 09:32:01 -0400 Subject: Adapt to the full_line_map change in Mako --- coverage/codeunit.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'coverage/codeunit.py') diff --git a/coverage/codeunit.py b/coverage/codeunit.py index 179de017..9282687d 100644 --- a/coverage/codeunit.py +++ b/coverage/codeunit.py @@ -236,8 +236,12 @@ class MakoParser(CodeParser): return executable, set() def translate_lines(self, lines): - tlines = set(self.metadata['full_line_map'].get(l, -1) for l in lines) - tlines.remove(-1) + tlines = set() + for l in lines: + try: + tlines.add(self.metadata['full_line_map'][l]) + except IndexError: + pass return tlines -- cgit v1.2.1