Browse Source

read from pyinstaller temp dir when frozen

pull/128/head
chriskiehl 9 years ago
parent
commit
660b0b07c0
1 changed files with 3 additions and 1 deletions
  1. 4
      gooey/gui/util/freeze.py

4
gooey/gui/util/freeze.py

@ -8,7 +8,9 @@ def is_frozen():
def get_resource_path(*args): def get_resource_path(*args):
if is_frozen(): if is_frozen():
resource_dir = os.path.join(os.path.dirname(sys.executable), 'gooey')
# MEIPASS explanation:
# https://pythonhosted.org/PyInstaller/#run-time-operation
resource_dir = os.path.join(sys._MEIPASS, 'gooey')
if not os.path.isdir(resource_dir): if not os.path.isdir(resource_dir):
raise IOError(("cannot locate Gooey resources. It seems that the program " raise IOError(("cannot locate Gooey resources. It seems that the program "
"was frozen, but resource files were not copied to " "was frozen, but resource files were not copied to "

Loading…
Cancel
Save