Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxGUI: Fixed E722 in ii2t_gis_set.py #4417

Merged
merged 6 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions gui/wxpython/image2target/ii2t_gis_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(self, parent=None, id=wx.ID_ANY, style=wx.DEFAULT_FRAME_STYLE):
self.hbitmap = wx.StaticBitmap(
self.panel, wx.ID_ANY, wx.Bitmap(name=name, type=wx.BITMAP_TYPE_PNG)
)
except:
except Exception:
self.hbitmap = wx.StaticBitmap(
self.panel, wx.ID_ANY, BitmapFromImage(wx.EmptyImage(530, 150))
)
Expand Down Expand Up @@ -824,8 +824,8 @@ def DeleteMapset(self, event):
shutil.rmtree(os.path.join(self.gisdbase, location, mapset))
self.OnSelectLocation(None)
self.lbmapsets.SetSelection(0)
except:
wx.MessageBox(message=_("Unable to delete mapset"))
except (OSError, shutil.Error) as e:
wx.MessageBox(message=_("Unable to delete mapset: %s") % str(e))

dlg.Destroy()

Expand Down Expand Up @@ -856,8 +856,8 @@ def DeleteLocation(self, event):
self.lblocations.SetSelection(0)
self.OnSelectLocation(None)
self.lbmapsets.SetSelection(0)
except:
wx.MessageBox(message=_("Unable to delete location"))
except (OSError, shutil.Error) as e:
wx.MessageBox(message=_("Unable to delete location: %s") % str(e))

dlg.Destroy()

Expand Down Expand Up @@ -1163,7 +1163,7 @@ def _getDefaultMapsetName(self):
defaultName = getpass.getuser()
# raise error if not ascii (not valid mapset name)
defaultName.encode("ascii")
except: # whatever might go wrong
except Exception: # whatever might go wrong
defaultName = "user"

return defaultName
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/image2target/ii2t_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ def OnSrcSelection(self, event):
if p.returncode == 0:
print("returncode = ", str(p.returncode))
self.parent.Map.region = self.parent.Map.GetRegion()
except:
except Exception:
pass

def OnTgtRastSelection(self, event):
Expand Down
Loading