diff --git a/.flake8 b/.flake8 index 3adda73f28..9cdfcbfc93 100644 --- a/.flake8 +++ b/.flake8 @@ -24,7 +24,7 @@ per-file-ignores = gui/scripts/d.wms.py: E501 gui/wxpython/image2target/g.gui.image2target.py: E501 gui/wxpython/photo2image/g.gui.photo2image.py: E501 - gui/wxpython/psmap/*: E501, E722 + gui/wxpython/psmap/*: E501 gui/wxpython/vdigit/*: F841, E722, F405, F403 gui/wxpython/animation/g.gui.animation.py: E501 gui/wxpython/tplot/frame.py: F841, E722 diff --git a/gui/wxpython/psmap/frame.py b/gui/wxpython/psmap/frame.py index 8926b8d1e7..0759b3f8a1 100644 --- a/gui/wxpython/psmap/frame.py +++ b/gui/wxpython/psmap/frame.py @@ -1049,7 +1049,7 @@ def makePSFont(self, textDict): fn = wx.Font( pointSize=fontsize, family=family, style=style, weight=weight, face=face ) - except: + except (ValueError, wx.PyAssertionError): fn = wx.Font( pointSize=fontsize, family=wx.FONTFAMILY_DEFAULT, @@ -1071,7 +1071,7 @@ def getTextExtent(self, textDict): dc.SetFont(fn) w, h, lh = dc.GetFullMultiLineTextExtent(textDict["text"]) return (w, h) - except: + except (wx.PyAssertionError, ValueError): return (0, 0) def getInitMap(self):