From 80fa9f4c583fd8621dda5d2cb14997cc3c3f82b5 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Mon, 2 Mar 2020 23:27:16 +0100 Subject: [PATCH] use executable location for local path, not Utils location. As it may be elsewhere. --- Utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Utils.py b/Utils.py index 7e066b5a..c3405b1d 100644 --- a/Utils.py +++ b/Utils.py @@ -30,8 +30,7 @@ def snes_to_pc(value): return ((value & 0x7F0000)>>1)|(value & 0x7FFF) def parse_player_names(names, players, teams): - names = (n.strip() for n in names.split(",")) - names = tuple(filter(bool, names)) + names = tuple(n for n in (n.strip() for n in names.split(",")) if n) ret = [] while names or len(ret) < teams: team = [n[:16] for n in names[:players]] @@ -58,7 +57,7 @@ def local_path(path): local_path.cached_path = os.path.dirname(sys.argv[0]) else: # we are running in a normal Python environment - local_path.cached_path = os.path.dirname(os.path.abspath(__file__)) + local_path.cached_path = os.path.dirname(os.path.abspath(sys.argv[0])) return os.path.join(local_path.cached_path, path) local_path.cached_path = None