diff --git a/.flake8 b/.flake8 index 6f7ca25c163..3bfab3179ce 100644 --- a/.flake8 +++ b/.flake8 @@ -37,7 +37,6 @@ per-file-ignores = gui/wxpython/mapswipe/g.gui.mapswipe.py: E501 gui/wxpython/mapwin/base.py: E722 gui/wxpython/mapwin/buffered.py: E722 - gui/wxpython/mapwin/graphics.py: E722 gui/wxpython/timeline/g.gui.timeline.py: E501 # Generated file gui/wxpython/menustrings.py: E501 diff --git a/gui/wxpython/mapwin/graphics.py b/gui/wxpython/mapwin/graphics.py index 0bc94bae6d2..b0cb7f36d6b 100644 --- a/gui/wxpython/mapwin/graphics.py +++ b/gui/wxpython/mapwin/graphics.py @@ -388,7 +388,7 @@ def _clearId(self, drawid): """Clears old object before drawing new object.""" try: self.pdc.ClearId(drawid) - except: + except (wx.PyDeadObjectError, KeyError): pass