From 63229f32c249c815f12ff5b024c7e0139ad6b4c7 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 9 Feb 2022 13:52:44 +0100 Subject: [PATCH] OP-2414 - refactor non python kwargs --- openpype/lib/execute.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openpype/lib/execute.py b/openpype/lib/execute.py index 703f443047..3dc7f8631d 100644 --- a/openpype/lib/execute.py +++ b/openpype/lib/execute.py @@ -289,19 +289,20 @@ def get_non_python_host_kwargs(kwargs, allow_console=True): """ if kwargs is None: kwargs = {} + if platform.system().lower() == "windows": executable_path = os.environ.get("OPENPYPE_EXECUTABLE") executable_filename = "" if executable_path: - executable_filename = os.path.dirname(executable_path) + executable_filename = os.path.basename(executable_path) if "openpype_gui" in executable_filename: kwargs.update({ "creationflags": subprocess.CREATE_NO_WINDOW, "stdout": subprocess.DEVNULL, "stderr": subprocess.DEVNULL }) - else: + elif allow_console: kwargs.update({ "creationflags": subprocess.CREATE_NEW_CONSOLE })