add missing exception message

This commit is contained in:
snoyer 2026-04-21 17:11:18 +04:00
parent a6a4f8c401
commit f2e504172b
2 changed files with 4 additions and 5 deletions

View file

@ -3050,12 +3050,11 @@ class Plane(metaclass=PlaneMeta):
return self.moved(other)
try:
others = list(other)
if any(not isinstance(other, Location | Plane) for other in others):
raise ValueError("Planes can only be multiplied by locations or planes")
return [self.moved(loc) for loc in others]
if all(isinstance(other, Location | Plane) for other in others):
return [self.moved(loc) for loc in others]
except TypeError: # not iterable
pass
raise TypeError()
raise TypeError("Planes can only be multiplied by locations or planes")
def __and__(self: Plane, other: Axis | Location | Plane | VectorLike | Shape):
"""intersect plane with other &"""

View file

@ -314,7 +314,7 @@ class TestPlane(unittest.TestCase):
with self.assertRaises(TypeError):
1 * p
with self.assertRaises(ValueError):
with self.assertRaises(TypeError):
(2, 3, 4) * p
def test_plane_mul_locations(self):