From 553483717720ceb4a1051819a96e6cc3897d4ca4 Mon Sep 17 00:00:00 2001 From: fengyu Date: Wed, 13 Aug 2014 00:22:16 +0800 Subject: [PATCH] support for frozen using cx_freeze --- you-get | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/you-get b/you-get index e576af99..f04cbc0d 100755 --- a/you-get +++ b/you-get @@ -4,7 +4,13 @@ import os, sys _srcdir = 'src/' -_filepath = os.path.dirname(os.path.realpath(__file__)) +if getattr(sys, 'frozen', False): + # The application is frozen + _filepath = os.path.dirname(os.path.realpath(sys.executable)) +else: + # The application is not frozen + # Change this bit to match where you store your data files: + _filepath = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(1, os.path.join(_filepath, _srcdir)) if sys.version_info[0] == 3: