Fix Maya 2022 Python 3 compatibility: types.BooleanType and types.ListType don't exist in Py3+

This commit is contained in:
Roy Nieterau 2021-12-24 15:11:53 +01:00
parent d9bdf007b8
commit d7b6582cd3
2 changed files with 4 additions and 4 deletions

View file

@ -110,9 +110,9 @@ class ValidateAssRelativePaths(pyblish.api.InstancePlugin):
Maya API will return a list of values, which need to be properly
handled to evaluate properly.
"""
if isinstance(attr_val, types.BooleanType):
if isinstance(attr_val, bool):
return attr_val
elif isinstance(attr_val, (types.ListType, types.GeneratorType)):
elif isinstance(attr_val, (list, types.GeneratorType)):
return any(attr_val)
else:
return bool(attr_val)

View file

@ -82,9 +82,9 @@ class ValidateVrayReferencedAOVs(pyblish.api.InstancePlugin):
bool: cast Maya attribute to Pythons boolean value.
"""
if isinstance(attr_val, types.BooleanType):
if isinstance(attr_val, bool):
return attr_val
elif isinstance(attr_val, (types.ListType, types.GeneratorType)):
elif isinstance(attr_val, (list, types.GeneratorType)):
return any(attr_val)
else:
return bool(attr_val)