From 7f964eb1755be61032b772172d784aba89c17b63 Mon Sep 17 00:00:00 2001 From: Arohan Ajit Date: Wed, 29 Jan 2025 15:59:12 -0500 Subject: [PATCH] wxGUI: Fixed bare except in mapdisp/main.py (#5006) --- .flake8 | 4 ---- gui/wxpython/mapdisp/main.py | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.flake8 b/.flake8 index c1e09d417a1..717b42fdc22 100644 --- a/.flake8 +++ b/.flake8 @@ -28,7 +28,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/mapdisp/main.py: E722 gui/wxpython/mapdisp/test_mapdisp.py: E501 gui/wxpython/mapswipe/g.gui.mapswipe.py: E501 gui/wxpython/mapwin/base.py: E722 @@ -40,9 +39,6 @@ per-file-ignores = # TODO: Is this really needed? python/grass/jupyter/__init__.py: E501 python/grass/pygrass/vector/__init__.py: E402 - # Current benchmarks/tests are changing sys.path before import. - # Possibly, a different approach should be taken there anyway. - python/grass/pygrass/tests/benchmark.py: F821 # Configuration file for Sphinx: # Ignoring import/code mix and line length. # Files not managed by Black diff --git a/gui/wxpython/mapdisp/main.py b/gui/wxpython/mapdisp/main.py index 6449bc35d7c..a19c79b5780 100644 --- a/gui/wxpython/mapdisp/main.py +++ b/gui/wxpython/mapdisp/main.py @@ -176,7 +176,7 @@ def GetLayersFromCmdFile(self): mapFile = line.split("=", 1)[1].strip() try: k, v = line[2:].strip().split("=", 1) - except: + except (ValueError, IndexError): pass render_env[k] = v continue