Skip to content

Commit

Permalink
Improve use of os.path.join
Browse files Browse the repository at this point in the history
  • Loading branch information
nOOb3167 authored and sfan5 committed Mar 18, 2018
1 parent f5bddaa commit 23d45c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server.py
Expand Up @@ -354,7 +354,7 @@ def purgeOld(self):
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
Expand All @@ -376,7 +376,7 @@ def save(self):
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},
Expand Down

0 comments on commit 23d45c0

Please sign in to comment.