Skip to content

Commit

Permalink
init: Use pathlib Path.read_text for readfile in main executable (OSG…
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix authored and Mahesh1998 committed Sep 19, 2024
1 parent 6778efe commit d391362
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/init/grass.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import unicodedata
import argparse
import json
from pathlib import Path


# mechanism meant for debugging this script (only)
Expand Down Expand Up @@ -167,10 +168,7 @@ def fatal(msg):

def readfile(path):
debug("Reading %s" % path)
f = open(path, "r")
s = f.read()
f.close()
return s
return Path(path).read_text()


def writefile(path, s):
Expand Down

0 comments on commit d391362

Please sign in to comment.