From f2e504172b1634dbf77abca08dc36f68a1544ca1 Mon Sep 17 00:00:00 2001 From: snoyer Date: Tue, 21 Apr 2026 17:11:18 +0400 Subject: [PATCH] add missing exception message --- src/build123d/geometry.py | 7 +++---- tests/test_direct_api/test_plane.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/build123d/geometry.py b/src/build123d/geometry.py index 9059c6fc..24b9ae0d 100644 --- a/src/build123d/geometry.py +++ b/src/build123d/geometry.py @@ -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 &""" diff --git a/tests/test_direct_api/test_plane.py b/tests/test_direct_api/test_plane.py index 8a0933f5..11541f5f 100644 --- a/tests/test_direct_api/test_plane.py +++ b/tests/test_direct_api/test_plane.py @@ -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):