start.py can use get_general_environments if is available

This commit is contained in:
iLLiCiTiT 2021-07-26 10:40:46 +02:00
parent 22876bbbde
commit 00ea737307

View file

@ -208,14 +208,21 @@ def set_openpype_global_environments() -> None:
"""Set global OpenPype's environments."""
import acre
from openpype.settings import get_environments
try:
from openpype.settings import get_general_environments
all_env = get_environments()
general_env = get_general_environments()
except Exception:
# Backwards compatibility for OpenPype versions where
# `get_general_environments` does not exists yet
from openpype.settings import get_environments
all_env = get_environments()
general_env = all_env["global"]
# TODO Global environments will be stored in "general" settings so loading
# will be modified and can be done in igniter.
env = acre.merge(
acre.parse(all_env["global"]),
acre.parse(general_env),
dict(os.environ)
)
os.environ.clear()