Skip to content

Commit

Permalink
add if condition to ask for _MEIPASS, else set os.path.dirname
Browse files Browse the repository at this point in the history
  • Loading branch information
vnj0x61 authored and JaDogg committed Nov 1, 2024
1 parent 4dc9d2a commit 11c7871
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pydoro/pydoro_core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 11c7871

Please sign in to comment.