Safer handling of PACKAGE_DIR

PACKAGE_DIR wasn't found in pre_non_python_host_launch.py in some edge cases
This commit is contained in:
Petr Kalis 2021-02-15 13:08:43 +01:00
parent 307f2c6bba
commit 8cbe6d3f68
2 changed files with 4 additions and 3 deletions

View file

@ -14,7 +14,7 @@ log = logging.getLogger(__name__)
PROJECT_PLUGINS_PATH = os.environ.get("PYPE_PROJECT_PLUGINS")
STUDIO_PLUGINS_PATH = os.environ.get("PYPE_STUDIO_PLUGINS")
PACKAGE_DIR = os.path.dirname(__file__)
PACKAGE_DIR = os.path.dirname(os.path.abspath(__file__))
PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins")
# Global plugin paths

View file

@ -4,7 +4,8 @@ from pype.lib import (
PreLaunchHook,
get_pype_execute_args
)
import pype.PACKAGE_DIR
from pype import PACKAGE_DIR as PYPE_DIR
class NonPythonHostHook(PreLaunchHook):
@ -26,7 +27,7 @@ class NonPythonHostHook(PreLaunchHook):
remainders.append(self.launch_context.launch_args.pop(0))
script_path = os.path.join(
pype.PACKAGE_DIR,
PYPE_DIR,
"scripts",
"non_python_host_launch.py"
)