Skip to content

Commit

Permalink
Use _MEIPASS only for pyinstaller frozen apps
Browse files Browse the repository at this point in the history
cx_freeze frozen apps don't define/use _MEIPASS
Fixes python-eel#371
  • Loading branch information
kakaroto committed Aug 4, 2020
1 parent e6db3f0 commit 1aa0706
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,11 @@ def _process_message(message, ws):


def _get_real_path(path):
if getattr(sys, 'frozen', False):
if getattr(sys, 'frozen', False) and hasattr(sys, "_MEIPASS"):
# Pyinstaller uses _MEIPASS for frozen paths
return os.path.join(sys._MEIPASS, path)
else:
# Unfrozen app or cx_freeze can use the path directly
return os.path.abspath(path)


Expand Down

0 comments on commit 1aa0706

Please sign in to comment.