From 195a8b5c20cf1fd8196576708446bc7e8003d608 Mon Sep 17 00:00:00 2001 From: xhlove Date: Sat, 31 Jul 2021 20:09:27 +0800 Subject: [PATCH] bug fix --- wvguesser/main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wvguesser/main.py b/wvguesser/main.py index 9e8cc74..057a692 100644 --- a/wvguesser/main.py +++ b/wvguesser/main.py @@ -20,9 +20,15 @@ # excepted_j = list(range(8)) if platform.system() == 'Windows': - MAIN_EXE = (Path(sys.argv[0]).parent / 'main.exe').resolve().as_posix() + MAIN_EXE = (Path(sys.argv[0]).parent / 'main.exe') + if MAIN_EXE.exists() is False: + MAIN_EXE = (Path('.').parent / 'main.exe') + MAIN_EXE = MAIN_EXE.resolve().as_posix() else: - MAIN_EXE = (Path(sys.argv[0]).parent / 'main').resolve().as_posix() + MAIN_EXE = (Path(sys.argv[0]).parent / 'main') + if MAIN_EXE.exists() is False: + MAIN_EXE = (Path('.').parent / 'main') + MAIN_EXE = MAIN_EXE.resolve().as_posix() def server_setup():