From 7743dc43196db8d0b5c277fb09e64fce2fd765fd Mon Sep 17 00:00:00 2001 From: Nick Dyer Date: Sun, 30 May 2021 00:34:07 -0400 Subject: [PATCH] fixed script directory sometime returning empty --- compile.py | 2 +- pocket_friends/game_files/game.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compile.py b/compile.py index 320c351..c46b9b8 100644 --- a/compile.py +++ b/compile.py @@ -2,7 +2,7 @@ import os import PyInstaller.__main__ import pocket_friends -script_dir = os.path.dirname(__file__) +script_dir = os.path.dirname(os.path.abspath(__file__)) PyInstaller.__main__.run([ '{0}/pocket_friends/__main__.py'.format(script_dir), diff --git a/pocket_friends/game_files/game.py b/pocket_friends/game_files/game.py index 426b4e2..5dc0f48 100644 --- a/pocket_friends/game_files/game.py +++ b/pocket_friends/game_files/game.py @@ -15,7 +15,7 @@ from ..hardware.gpio_handler import Constants, GPIOHandler game_fps = 16 # Gets the directory of the script for importing and the save directory -script_dir = os.path.dirname(__file__) +script_dir = os.path.dirname(os.path.abspath(__file__)) save_dir = os.path.join(Path.home(), '.pocket_friends') # Tries to make the save directory. Does nothing if it already exists.