diff --git a/tests/filterpyflakes.py b/tests/filterpyflakes.py --- a/tests/filterpyflakes.py +++ b/tests/filterpyflakes.py @@ -24,10 +24,9 @@ for line in sys.stdin: break # pattern matches if keep: fn = line.split(':', 1)[0] - f = open(fn) - data = f.read() - f.close() - if 'no-' 'check-code' in data: + with open(fn, 'rb') as f: + data = f.read() + if b'no-' b'check-code' in data: continue lines.append(line)