Use native open/io.open for file contents reading/writing

This commit is contained in:
Ivan Kravets
2020-03-05 23:52:13 +02:00
parent 3275bb59bf
commit ce6b96ea84
10 changed files with 56 additions and 39 deletions

View File

@@ -53,9 +53,12 @@ def clean_build_dir(build_dir, config):
if isdir(build_dir):
# check project structure
if isfile(checksum_file) and fs.get_file_contents(checksum_file) == checksum:
return
if isfile(checksum_file):
with open(checksum_file) as fp:
if fp.read() == checksum:
return
fs.rmtree(build_dir)
makedirs(build_dir)
fs.write_file_contents(checksum_file, checksum)
with open(checksum_file, "w") as fp:
fp.write(checksum)