mirror of
https://github.com/gumyr/build123d.git
synced 2026-05-10 14:13:45 -07:00
add missing exception message
This commit is contained in:
parent
a6a4f8c401
commit
f2e504172b
2 changed files with 4 additions and 5 deletions
|
|
@ -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 &"""
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue