Cleanup: use context-manager for opening files

This commit is contained in:
Campbell Barton
2025-01-04 22:26:18 +11:00
parent 0f1e1bcdae
commit c5203ef7fd
4 changed files with 19 additions and 24 deletions

View File

@@ -149,9 +149,8 @@ def main():
md5_update = md5_instance.update
for f in md5_source:
filehandle = open(f, "rb")
md5_update(filehandle.read())
filehandle.close()
with open(f, "rb") as fh:
md5_update(fh.read())
md5_new = md5_instance.hexdigest()