From 3b4503b88c1db3094c17f252bbc5a2b388bc3c07 Mon Sep 17 00:00:00 2001 From: vnj0x61 <8861421+vnj0x61@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:52:36 +0100 Subject: [PATCH] add if condition to ask for _MEIPASS, else set os.path.dirname --- pydoro/pydoro_core/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pydoro/pydoro_core/util.py b/pydoro/pydoro_core/util.py index 7589bdc..9446d47 100644 --- a/pydoro/pydoro_core/util.py +++ b/pydoro/pydoro_core/util.py @@ -14,12 +14,14 @@ def every(delay, task): def in_app_path(path): try: - wd = sys._MEIPASS + if hasattr(sys, '_MEIPASS'): + wd = sys._MEIPASS + else: + wd = os.path.dirname(__file__) return os.path.abspath(os.path.join(wd, path)) except AttributeError: return _from_resource(path) - def _from_resource(path): from pkg_resources import resource_filename