Skip to content

Commit

Permalink
Drop attempts at py<3.6 compatibility
Browse files Browse the repository at this point in the history
Wake up, it's 2023 now. Also f-strings has been used prominently already
  • Loading branch information
caryoscelus committed Jul 29, 2023
1 parent 714729e commit a509032
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/Content/ContentManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,10 +928,7 @@ def verifyFile(self, inner_path, file, ignore_same=True):
new_content = file
else:
try:
if sys.version_info.major == 3 and sys.version_info.minor < 6:
new_content = json.loads(file.read().decode("utf8"))
else:
new_content = json.load(file)
new_content = json.load(file)
except Exception as err:
raise VerifyError(f"Invalid json file: {err}")
if inner_path in self.contents:
Expand Down
5 changes: 1 addition & 4 deletions src/Db/Db.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,7 @@ def updateJson(self, file_path, file=None, cur=None):
if file_path.endswith("json.gz"):
file = helper.limitedGzipFile(fileobj=file)

if sys.version_info.major == 3 and sys.version_info.minor < 6:
data = json.loads(file.read().decode("utf8"))
else:
data = json.load(file)
data = json.load(file)
except Exception as err:
self.log.debug("Json file %s load error: %s" % (file_path, err))
data = {}
Expand Down

0 comments on commit a509032

Please sign in to comment.