summaryrefslogtreecommitdiffstats
path: root/test/CFILESUFFIX.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/CFILESUFFIX.py')
-rw-r--r--test/CFILESUFFIX.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/CFILESUFFIX.py b/test/CFILESUFFIX.py
index 410ece5..7af4fa4 100644
--- a/test/CFILESUFFIX.py
+++ b/test/CFILESUFFIX.py
@@ -45,7 +45,8 @@ else:
longopts = []
cmd_opts, args = getopt.getopt(sys.argv[1:], 't', longopts)
for a in args:
- contents = open(a, 'rb').read()
+ with open(a, 'rb') as f:
+ contents = f.read()
sys.stdout.write((contents.replace(b'LEX', b'mylex.py')).decode())
sys.exit(0)
""")