From 7fe3fd1d11a66de9dbfbc479bd91cd0cb7d35013 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 21 Sep 2021 14:06:25 +0200 Subject: [PATCH] show tkinter message box if validation crashes --- start.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/start.py b/start.py index a02c06661f..8b4ee97b09 100644 --- a/start.py +++ b/start.py @@ -359,7 +359,23 @@ def is_tool(name): def _startup_validations(): """Validations before OpenPype starts.""" - _validate_thirdparty_binaries() + try: + _validate_thirdparty_binaries() + except Exception as exc: + if os.environ.get("OPENPYPE_HEADLESS_MODE"): + raise + + from tkinter import Tk + from tkinter.messagebox import showerror + + root = Tk() + root.withdraw() + showerror( + "Startup validations didn't pass", + str(exc) + ) + root.destroy() + sys.exit(1) def _validate_thirdparty_binaries():