From 23d45c0a15e30ce7f5293139f28e323295f0e154 Mon Sep 17 00:00:00 2001 From: nOOb3167 Date: Sun, 18 Mar 2018 02:47:16 -0400 Subject: [PATCH] Improve use of os.path.join --- server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 3fe9780..960009f 100755 --- a/server.py +++ b/server.py @@ -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},