From a77a2bfdc8fec561357bf083eaa3847a7e6a3684 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Thu, 10 Sep 2020 16:30:07 +0200 Subject: trim-lcov.py: Port trim-lcov to Python 3 Fixes #8 --- trim-lcov.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/trim-lcov.py b/trim-lcov.py index 78613d3..2cd8dee 100755 --- a/trim-lcov.py +++ b/trim-lcov.py @@ -1,4 +1,5 @@ -#!/usr/bin/python +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- # This script removes branch and/or line coverage data for lines that # contain a particular substring. @@ -38,7 +39,10 @@ for line in sys.stdin: # Source file if keyword == 'SF': - source = file(rest).readlines() + + with open(rest, 'r') as pFile: + + source = pFile.readlines() # Branch coverage data elif keyword == 'BRDA': @@ -50,4 +54,4 @@ for line in sys.stdin: if check_suppress(line_suppress, source, rest): continue - print line + print(line) -- cgit v1.2.3