Skip to content

Commit

Permalink
Merge pull request #187 from mrf345/testing
Browse files Browse the repository at this point in the history
Fix MacOs exe base directory. Resolves #186
  • Loading branch information
mrf345 authored Jul 9, 2020
2 parents 6953063 + c367056 commit 75bae3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
from collections import namedtuple
from uuid import uuid4
from traceback import TracebackException
Expand Down Expand Up @@ -63,8 +64,9 @@ def absolute_path(relative_path):
Absolute path from `relative_path`
'''
delimiter = '\\' if os.name == 'nt' else '/'
base_path = os.path.abspath('.')
clean_path = relative_path
base_path = os.path.dirname(sys.executable)\
if getattr(sys, 'frozen', False) else os.path.abspath('.')

if clean_path.startswith(delimiter):
clean_path = clean_path[len(delimiter):]
Expand Down

0 comments on commit 75bae3b

Please sign in to comment.