diff options
| author | capellancitizen <thecapellancitizen@gmail.com> | 2025-03-09 21:21:48 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-09 21:21:48 -0400 |
| commit | 99509df8d8abf1e7b701a4a09cf170a362f6d878 (patch) | |
| tree | a461549502fa9f37dc287789b6c7db81dfcd5368 /lib/elements/fill_stitch.py | |
| parent | 0d2fc24f25f87562f0755b53dad6204efad1330d (diff) | |
Mypy type correctness (#3199)
Diffstat (limited to 'lib/elements/fill_stitch.py')
| -rw-r--r-- | lib/elements/fill_stitch.py | 8 |
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: |
