Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Fix Maya 2022 Python 3 compatibility: types.BooleanType and types.Lis…
Browse files Browse the repository at this point in the history
…tType don't exist in Py3+
  • Loading branch information
BigRoy committed Dec 24, 2021
1 parent d9bdf00 commit d7b6582
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def maya_is_true(self, attr_val):
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)
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def maya_is_true(attr_val):
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)

0 comments on commit d7b6582

Please sign in to comment.