diff --git a/.flake8 b/.flake8 index 91af147aefb..99c6e425717 100644 --- a/.flake8 +++ b/.flake8 @@ -29,7 +29,6 @@ per-file-ignores = gui/wxpython/animation/g.gui.animation.py: E501 gui/wxpython/tplot/g.gui.tplot.py: E501 gui/wxpython/iclass/g.gui.iclass.py: E501 - gui/wxpython/location_wizard/wizard.py: E722 gui/wxpython/mapdisp/main.py: E722 gui/wxpython/mapdisp/test_mapdisp.py: E501 gui/wxpython/mapswipe/g.gui.mapswipe.py: E501 diff --git a/gui/wxpython/location_wizard/wizard.py b/gui/wxpython/location_wizard/wizard.py index c12fb22860f..52b8a87270d 100644 --- a/gui/wxpython/location_wizard/wizard.py +++ b/gui/wxpython/location_wizard/wizard.py @@ -618,7 +618,7 @@ def OnSearch(self, event): self.proj, self.projdesc = self.projlist.Search( index=[0, 1], pattern=search_str ) - except: + except (IndexError, ValueError): self.proj = self.projdesc = "" event.Skip() @@ -1188,15 +1188,15 @@ def OnDText(self, event): self.datumparams = self.parent.datums[self.datum][2] try: self.datumparams.remove("dx=0.0") - except: + except ValueError: pass try: self.datumparams.remove("dy=0.0") - except: + except ValueError: pass try: self.datumparams.remove("dz=0.0") - except: + except ValueError: pass nextButton.Enable(True) @@ -1211,7 +1211,7 @@ def OnDSearch(self, event): self.datum, self.ellipsoid, self.datumdesc = self.datumlist.Search( index=[0, 1, 2], pattern=search_str ) - except: + except (IndexError, ValueError): self.datum = self.datumdesc = self.ellipsoid = "" event.Skip() @@ -1392,7 +1392,7 @@ def OnSearch(self, event): self.ellipseparams = self.parent.ellipsoids[self.ellipse][1] else: self.ellipseparams = self.parent.planetary_ellipsoids[self.ellipse][1] - except: + except (IndexError, ValueError, KeyError): self.ellipse = self.ellipsedesc = self.ellipseparams = "" event.Skip() @@ -1935,7 +1935,7 @@ def OnText(self, event): self.epsgcode = event.GetString() try: self.epsgcode = int(self.epsgcode) - except: + except ValueError: self.epsgcode = None nextButton = wx.FindWindowById(wx.ID_FORWARD) @@ -2558,7 +2558,7 @@ def __readData(self): plist.append(p) self.projections[proj.lower().strip()] = (projdesc.strip(), plist) self.projdesc[proj.lower().strip()] = projdesc.strip() - except: + except (ValueError, IndexError): continue f.close() @@ -2620,7 +2620,7 @@ def __readData(self): try: pparam, datatype, proj4term, desc = line.split(":") self.paramdesc[pparam] = (datatype, proj4term, desc) - except: + except ValueError: continue f.close()