diff --git a/sc2/bot_ai.py b/sc2/bot_ai.py index eccf2ba8..5e56d8f8 100644 --- a/sc2/bot_ai.py +++ b/sc2/bot_ai.py @@ -781,7 +781,7 @@ def structure_type_build_progress(self, structure_type: UnitTypeId | int) -> flo :param structure_type: """ assert isinstance( - structure_type, int | UnitTypeId + structure_type, (int, UnitTypeId) ), f"Needs to be int or UnitTypeId, but was: {type(structure_type)}" if isinstance(structure_type, int): structure_type_value: int = structure_type diff --git a/sc2/unit.py b/sc2/unit.py index 7d705fe9..01d1bdbf 100644 --- a/sc2/unit.py +++ b/sc2/unit.py @@ -593,7 +593,7 @@ def in_ability_cast_range(self, ability_id: AbilityId, target: Unit | Point2, bo ) # For casting abilities on the ground, like queen creep tumor, ravager bile, HT storm if ability_target_type in {Target.Point.value, Target.PointOrUnit.value} and isinstance( - target, (Point2 | tuple) + target, (Point2, tuple) ): return ( self._bot_object._distance_pos_to_pos(self.position_tuple, target)