From df6031d810a8d3e6c222087f5149e86cc84d4a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Thu, 2 Feb 2023 11:40:06 +0100 Subject: [PATCH] Update openpype/hosts/max/startup/startup.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/hosts/max/startup/startup.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/openpype/hosts/max/startup/startup.py b/openpype/hosts/max/startup/startup.py index 21da115baa..0d3135a16f 100644 --- a/openpype/hosts/max/startup/startup.py +++ b/openpype/hosts/max/startup/startup.py @@ -4,17 +4,12 @@ import sys # this might happen in some 3dsmax version where PYTHONPATH isn't added # to sys.path automatically -try: - from openpype.hosts.max.api import MaxHost - from openpype.pipeline import install_host -except (ImportError, ModuleNotFoundError): +for path in os.environ["PYTHONPATH"].split(os.pathsep): + if path and path not in sys.path: + sys.path.append(path) - for path in os.environ["PYTHONPATH"].split(os.pathsep): - if path and path not in sys.path: - sys.path.append(path) - - from openpype.hosts.max.api import MaxHost - from openpype.pipeline import install_host +from openpype.hosts.max.api import MaxHost +from openpype.pipeline import install_host host = MaxHost() install_host(host)