From e9bcdc910a2101c0da2fa379da36e1d1be2fe3f2 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Thu, 21 Aug 2025 16:10:48 -0400 Subject: fix type errors (#3928) * fix type checking error in overriding path propery * fix type hints in sew stack * enable type checking for tartan * ignore type warnings for dynamic wx module attributes * fix tartan type errors * fix circular import * add type-check and test targets * use Optional instead --- lib/tartan/palette.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/tartan/palette.py') diff --git a/lib/tartan/palette.py b/lib/tartan/palette.py index b8c36331..09dfb373 100644 --- a/lib/tartan/palette.py +++ b/lib/tartan/palette.py @@ -64,7 +64,7 @@ class Palette: stripe = {'render': 1, 'color': '#000000', 'width': '5'} stripe_panel = cast('StripePanel', stripe_sizer.GetWindow()) stripe['render'] = stripe_panel.visibility.Get3StateValue() - stripe['color'] = stripe_panel.colorpicker.GetColour().GetAsString(wx.C2S_HTML_SYNTAX) + stripe['color'] = stripe_panel.colorpicker.GetColour().GetAsString(wx.C2S_HTML_SYNTAX) # type: ignore[attr-defined] stripe['width'] = stripe_panel.stripe_width.GetValue() stripes.append(stripe) self.palette_stripes[i] = stripes @@ -173,8 +173,8 @@ class Palette: try: # on macOS we need to run wxpython color method inside the app otherwise # the color picker has issues in some cases to accept our input - color = wx.Colour(color).GetAsString(wx.C2S_HTML_SYNTAX) - except wx.PyNoAppError: + color = wx.Colour(color).GetAsString(wx.C2S_HTML_SYNTAX) # type: ignore[attr-defined] + except wx.PyNoAppError: # type: ignore[attr-defined] # however when we render an embroidery element we do not want to open wx.App try: color = str(Color(color).to_named()) -- cgit v1.2.3