From 6a6dcbd1303a85c3cbce476deb882b859507ecb6 Mon Sep 17 00:00:00 2001 From: Arohan Ajit Date: Tue, 1 Oct 2024 12:37:06 -0400 Subject: [PATCH 1/2] fixed e722 --- .flake8 | 2 +- gui/wxpython/iscatt/controllers.py | 4 ++-- gui/wxpython/iscatt/frame.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.flake8 b/.flake8 index 580aa6670a1..32b0191e00c 100644 --- a/.flake8 +++ b/.flake8 @@ -27,7 +27,7 @@ per-file-ignores = gui/scripts/d.wms.py: E501 gui/wxpython/image2target/*: F841, E722 gui/wxpython/image2target/g.gui.image2target.py: E501, F841 - gui/wxpython/iscatt/*: F841, E722, F405, F403 + gui/wxpython/iscatt/*: F841, F405, F403 gui/wxpython/lmgr/frame.py: F841, E722 # layertree still includes some formatting issues (it is ignored by Black) gui/wxpython/lmgr/layertree.py: E722, E266, W504, E225 diff --git a/gui/wxpython/iscatt/controllers.py b/gui/wxpython/iscatt/controllers.py index e8884f4f78b..aed917aacad 100644 --- a/gui/wxpython/iscatt/controllers.py +++ b/gui/wxpython/iscatt/controllers.py @@ -597,7 +597,7 @@ def _renderscattplts(self, scatt_ids, cats, cats_attrs): try: self.cat_ids.remove(c) scatt_dt[c]["render"] = True - except: + except ValueError: scatt_dt[c]["render"] = False if self.scatt_mgr.pol_sel_mode[0]: @@ -674,7 +674,7 @@ def ChangePosition(self, cat_id, new_pos): try: pos = self.cats_ids.index(cat_id) - except: + except ValueError: return False if pos > new_pos: diff --git a/gui/wxpython/iscatt/frame.py b/gui/wxpython/iscatt/frame.py index 45f50622d2f..e2465498022 100644 --- a/gui/wxpython/iscatt/frame.py +++ b/gui/wxpython/iscatt/frame.py @@ -249,7 +249,7 @@ def CursorPlotMove(self, x, y, scatt_id): x = int(round(x)) y = int(round(y)) coords = True - except: + except (ValueError, TypeError): coords = False pane = self._getPane(scatt_id) From ba508afb0dc8fc6f5ac4131da4f361cf2c524ae8 Mon Sep 17 00:00:00 2001 From: Arohan Ajit Date: Tue, 1 Oct 2024 11:32:46 -0700 Subject: [PATCH 2/2] Update frame.py --- gui/wxpython/iscatt/frame.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/wxpython/iscatt/frame.py b/gui/wxpython/iscatt/frame.py index e2465498022..803b2344144 100644 --- a/gui/wxpython/iscatt/frame.py +++ b/gui/wxpython/iscatt/frame.py @@ -249,7 +249,7 @@ def CursorPlotMove(self, x, y, scatt_id): x = int(round(x)) y = int(round(y)) coords = True - except (ValueError, TypeError): + except TypeError: coords = False pane = self._getPane(scatt_id)