Use pathclass.Path.open.

This commit is contained in:
Ethan Dalool 2020-09-20 18:30:37 -07:00
parent dc98f09f45
commit 753c1cebb5

View file

@ -44,7 +44,7 @@ def write(path, content):
if path not in writing_rootdir: if path not in writing_rootdir:
raise ValueError(path) raise ValueError(path)
print(path.absolute_path) print(path.absolute_path)
f = open(path.absolute_path, 'w', encoding='utf-8') f = path.open('w', encoding='utf-8')
f.write(content) f.write(content)
f.close() f.close()