Commit e03925d0 authored by Lucas Carvalho's avatar Lucas Carvalho

Good pratice when you have to write data in a binary file.

parent f35a9b0d
...@@ -91,6 +91,7 @@ def download_network_cached(sha_dir, sha_cache, path, url, logger, md5sum=None): ...@@ -91,6 +91,7 @@ def download_network_cached(sha_dir, sha_cache, path, url, logger, md5sum=None):
f = open(path, 'w+b') f = open(path, 'w+b')
try: try:
f.seek(0)
f.write(file_content) f.write(file_content)
finally: finally:
f.close() f.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment