Use with statement

master
David Fischer 2016-01-31 14:20:38 +01:00
parent 8a0cf24ee4
commit b9dacd3664
1 changed files with 2 additions and 3 deletions

View File

@ -16,6 +16,5 @@ if not os.path.exists(dir_path_to_conf):
os.makedirs(dir_path_to_conf)
if not os.path.exists(file_path_to_conf):
f = open(file_path_to_conf, "w")
f.write(text)
f.close
with open(file_path_to_conf, 'w') as f:
f.write(text)