1
0
Fork 0

python: use a with-statement to manage file close

This commit is contained in:
Scott Giese 2020-10-01 22:51:31 -05:00
parent 7714abd56e
commit 22e9d0e2f1

View file

@ -151,11 +151,8 @@ def output_text(top_namespaces,modules,version):
fw.close()
def parse_file(filename):
try:
fr = open(filename,'rb')
with open(filename,'rb') as fr:
content = fr.readlines()
finally:
fr.close()
i=0
retval=[]