mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Fix colorspace compatibility check (#5334)
* update compatibility_check * update doc-string
This commit is contained in:
parent
a87fdd5173
commit
afbd3d392d
1 changed files with 10 additions and 3 deletions
|
|
@ -237,10 +237,17 @@ def get_data_subprocess(config_path, data_type):
|
||||||
|
|
||||||
|
|
||||||
def compatibility_check():
|
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:
|
try:
|
||||||
import PyOpenColorIO # noqa: F401
|
import PyOpenColorIO
|
||||||
except ImportError:
|
|
||||||
|
# ocio versions lower than 2 will raise AttributeError
|
||||||
|
PyOpenColorIO.GetVersion()
|
||||||
|
except (ImportError, AttributeError):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue