# HG changeset patch # User Arseniy Alekseyev # Date 2023-03-10 11:20:18 # Node ID e07dc1e7a45435e962e072b3831b3c2a7979710c # Parent 584ff1f9720113bf3e5745f5c3fbd3a30e41cd97 tests: in filterpyflakes, tolerate non-ascii file contents 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)