diff --git a/gui/wxpython/vdigit/dialogs.py b/gui/wxpython/vdigit/dialogs.py index 27d34601459..369855c94fc 100644 --- a/gui/wxpython/vdigit/dialogs.py +++ b/gui/wxpython/vdigit/dialogs.py @@ -252,7 +252,7 @@ def OnEndEdit(self, event): self.cats[self.fid][layerNew] = [] self.cats[self.fid][layerNew].append(catNew) self.cats[self.fid][layerOld].remove(catOld) - except: + except (KeyError, ValueError, AttributeError): event.Veto() self.list.SetItem(itemIndex, 0, str(layerNew)) self.list.SetItem(itemIndex, 1, str(catNew)) diff --git a/gui/wxpython/vdigit/preferences.py b/gui/wxpython/vdigit/preferences.py index 949b4e5ccae..6174a4d6680 100644 --- a/gui/wxpython/vdigit/preferences.py +++ b/gui/wxpython/vdigit/preferences.py @@ -199,7 +199,7 @@ def _createGeneralPage(self, notebook): self.snappingUnit.SetSelection( UserSettings.Get(group="vdigit", key="snapping", subkey="unit") ) - except: + except KeyError: self.snappingUnit.SetSelection(0) self.snappingUnit.Bind(wx.EVT_CHOICE, self.OnChangeSnappingUnits) flexSizer.Add(text, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL)