Skip to content

Commit 23d45c0

Browse files
nOOb3167sfan5
authored andcommittedMar 18, 2018
Improve use of os.path.join
1 parent f5bddaa commit 23d45c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎server.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def purgeOld(self):
354354
def load(self):
355355
with self.lock:
356356
try:
357-
with open(os.path.join("static", "list.json"), "r") as fd:
357+
with open(os.path.join(app.static_folder, "list.json"), "r") as fd:
358358
data = json.load(fd)
359359
except FileNotFoundError:
360360
return
@@ -376,7 +376,7 @@ def save(self):
376376
self.maxServers = max(servers, self.maxServers)
377377
self.maxClients = max(clients, self.maxClients)
378378

379-
list_path = os.path.join(app.root_path, app.static_folder, "list.json")
379+
list_path = os.path.join(app.static_folder, "list.json")
380380
with open(list_path + "~", "w") as fd:
381381
json.dump({
382382
"total": {"servers": servers, "clients": clients},

0 commit comments

Comments
 (0)
Please sign in to comment.