Fix colorspace compatibility check (#5334)

* update compatibility_check

* update doc-string
This commit is contained in:
Mustafa Zarkash 2023-07-25 16:43:59 +03:00 committed by GitHub
parent a87fdd5173
commit afbd3d392d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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