From afbd3d392d4cc9dfa6707192a365e07b4bc0de21 Mon Sep 17 00:00:00 2001 From: Mustafa Zarkash Date: Tue, 25 Jul 2023 16:43:59 +0300 Subject: [PATCH] Fix colorspace compatibility check (#5334) * update compatibility_check * update doc-string --- openpype/pipeline/colorspace.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/openpype/pipeline/colorspace.py b/openpype/pipeline/colorspace.py index 3f2d4891c1..caa0f6dcd7 100644 --- a/openpype/pipeline/colorspace.py +++ b/openpype/pipeline/colorspace.py @@ -237,10 +237,17 @@ def get_data_subprocess(config_path, data_type): def compatibility_check(): - """Making sure PyOpenColorIO is importable""" + """checking if user has a compatible PyOpenColorIO >= 2. + + It's achieved by checking if PyOpenColorIO is importable + and calling any version 2 specific function + """ try: - import PyOpenColorIO # noqa: F401 - except ImportError: + import PyOpenColorIO + + # ocio versions lower than 2 will raise AttributeError + PyOpenColorIO.GetVersion() + except (ImportError, AttributeError): return False return True