@@ -726,17 +726,17 @@ def tick(self) -> typing.Iterator[behaviour.Behaviour]:
726726 self .current_child = failed_child
727727 new_status = common .Status .FAILURE
728728 except StopIteration :
729- if type (self .policy ) is common .ParallelPolicy .SuccessOnAll :
729+ if isinstance (self .policy , common .ParallelPolicy .SuccessOnAll ) :
730730 if all (c .status == common .Status .SUCCESS for c in self .children ):
731731 new_status = common .Status .SUCCESS
732732 self .current_child = self .children [- 1 ]
733- elif type (self .policy ) is common .ParallelPolicy .SuccessOnOne :
733+ elif isinstance (self .policy , common .ParallelPolicy .SuccessOnOne ) :
734734 for child in reversed (self .children ):
735735 if child .status == common .Status .SUCCESS :
736736 new_status = common .Status .SUCCESS
737737 self .current_child = child
738738 break
739- elif type (self .policy ) is common .ParallelPolicy .SuccessOnSelected :
739+ elif isinstance (self .policy , common .ParallelPolicy .SuccessOnSelected ) :
740740 if all (
741741 [c .status == common .Status .SUCCESS for c in self .policy .children ]
742742 ):
@@ -786,7 +786,7 @@ def validate_policy_configuration(self) -> None:
786786 Raises:
787787 RuntimeError: if policy configuration was invalid
788788 """
789- if type (self .policy ) is common .ParallelPolicy .SuccessOnSelected :
789+ if isinstance (self .policy , common .ParallelPolicy .SuccessOnSelected ) :
790790 if not self .policy .children :
791791 error_message = (
792792 "policy SuccessOnSelected requires a non-empty "
0 commit comments