Improve use of os.path.join

This commit is contained in:
nOOb3167
2018-03-18 02:47:16 -04:00
committed by sfan5
parent f5bddaaef5
commit 23d45c0a15

View File

@@ -354,7 +354,7 @@ class ServerList:
def load(self):
with self.lock:
try:
with open(os.path.join("static", "list.json"), "r") as fd:
with open(os.path.join(app.static_folder, "list.json"), "r") as fd:
data = json.load(fd)
except FileNotFoundError:
return
@@ -376,7 +376,7 @@ class ServerList:
self.maxServers = max(servers, self.maxServers)
self.maxClients = max(clients, self.maxClients)
list_path = os.path.join(app.root_path, app.static_folder, "list.json")
list_path = os.path.join(app.static_folder, "list.json")
with open(list_path + "~", "w") as fd:
json.dump({
"total": {"servers": servers, "clients": clients},