summaryrefslogtreecommitdiff
path: root/lib/elements/fill_stitch.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/elements/fill_stitch.py')
-rw-r--r--lib/elements/fill_stitch.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py
index f8db39d5..ee77cd60 100644
--- a/lib/elements/fill_stitch.py
+++ b/lib/elements/fill_stitch.py
@@ -808,13 +808,17 @@ class FillStitch(EmbroideryElement):
def validation_errors(self):
if not self.shape.is_valid:
why = explain_validity(self.shape)
- message, x, y = re.match(r"(?P<message>.+)\[(?P<x>.+)\s(?P<y>.+)\]", why).groups()
+ match = re.match(r"(?P<message>.+)\[(?P<x>.+)\s(?P<y>.+)\]", why)
+ assert match is not None, f"Could not parse validity message '{why}'"
+ message, x, y = match.groups()
yield InvalidShapeError((x, y))
def validation_warnings(self): # noqa: C901
if not self.original_shape.is_valid:
why = explain_validity(self.original_shape)
- message, x, y = re.match(r"(?P<message>.+)\[(?P<x>.+)\s(?P<y>.+)\]", why).groups()
+ match = re.match(r"(?P<message>.+)\[(?P<x>.+)\s(?P<y>.+)\]", why)
+ assert match is not None, f"Could not parse validity message '{why}'"
+ message, x, y = match.groups()
if "Hole lies outside shell" in message:
yield UnconnectedWarning((x, y))
else: