Skip to content

Commit

Permalink
Merge pull request ZeroNetX#226 from caryoscelus/drop-py35
Browse files Browse the repository at this point in the history
Drop attempts at py<3.6 compatibility
  • Loading branch information
caryoscelus authored Jul 30, 2023
2 parents 714729e + a509032 commit a209f6a
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 a209f6a

Please sign in to comment.