Skip to content

Commit

Permalink
init: Use pathlib Path.write_text for writefile in the main executable (
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix authored Aug 29, 2024
1 parent b61c61d commit c6b1976
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/init/grass.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ def readfile(path):

def writefile(path, s):
debug("Writing %s" % path)
f = open(path, "w")
f.write(s)
f.close()
Path(path).write_text(s)


def call(cmd, **kwargs):
Expand Down

0 comments on commit c6b1976

Please sign in to comment.