From 10a53d966dc7b310d6f4fe06883c25ffd4e25b27 Mon Sep 17 00:00:00 2001 From: Fumiya Funatsu Date: Thu, 24 Nov 2022 09:48:33 +0900 Subject: [PATCH 1/2] Use _MEIPASS only for pyinstaller frozen apps --- eel/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eel/__init__.py b/eel/__init__.py index 1f9d8bf4..8105dc58 100644 --- a/eel/__init__.py +++ b/eel/__init__.py @@ -312,7 +312,7 @@ def _process_message(message, ws): def _get_real_path(path): - if getattr(sys, 'frozen', False): + if getattr(sys, 'frozen', False) and hasattr(sys, "_MEIPASS"): return os.path.join(sys._MEIPASS, path) else: return os.path.abspath(path) From db22890f86316aed9cdc342b54331bd49cc50a56 Mon Sep 17 00:00:00 2001 From: Fumiya Funatsu Date: Thu, 24 Nov 2022 09:54:55 +0900 Subject: [PATCH 2/2] fix realpath --- eel/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eel/__init__.py b/eel/__init__.py index 8105dc58..4ff8188c 100644 --- a/eel/__init__.py +++ b/eel/__init__.py @@ -314,6 +314,8 @@ def _process_message(message, ws): def _get_real_path(path): if getattr(sys, 'frozen', False) and hasattr(sys, "_MEIPASS"): return os.path.join(sys._MEIPASS, path) + elif getattr(sys, 'frozen', False): + return os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), path) else: return os.path.abspath(path)