From a4dcaa2275feb3428c88a33ddb046063b3a9f52b Mon Sep 17 00:00:00 2001 From: arohanajit Date: Sat, 7 Sep 2024 20:56:00 -0400 Subject: [PATCH 1/2] fixed flake8 errors in lib/init/grass.py --- lib/init/grass.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/init/grass.py b/lib/init/grass.py index 82c1ee4a812..5a62e65ac53 100755 --- a/lib/init/grass.py +++ b/lib/init/grass.py @@ -484,7 +484,7 @@ def create_gisrc(tmpdir, gisrcrc): if "UNKNOWN" in s: try_remove(gisrcrc) s = None - except: + except Exception: s = None # Copy the global grassrc file to the session grassrc file @@ -1162,7 +1162,7 @@ def set_language(grass_config_dir): encoding = "UTF-8" normalized = locale.normalize("%s.%s" % (language, encoding)) locale.setlocale(locale.LC_ALL, normalized) - except locale.Error as e: + except locale.Error: if language == "en": # A workaround for Python Issue30755 # https://bugs.python.org/issue30755 @@ -1188,7 +1188,7 @@ def set_language(grass_config_dir): # See bugs #3441 and #3423 try: locale.setlocale(locale.LC_ALL, "C.UTF-8") - except locale.Error as e: + except locale.Error: # All lost. Setting to C as much as possible. # We can not call locale.normalize on C as it # will transform it to en_US and we already know @@ -1571,7 +1571,7 @@ def say_hello(): revision = linerev.split(" ")[1] sys.stderr.write(" (" + revision + ")") - except: + except Exception: pass @@ -1937,7 +1937,7 @@ def print_params(params): try: revision = linerev.split(" ")[1] sys.stdout.write("%s\n" % revision[1:]) - except: + except Exception: sys.stdout.write("No SVN revision defined\n") elif arg == "version": sys.stdout.write("%s\n" % GRASS_VERSION) From 35308537b9536707aeca700229271c9b27a905c9 Mon Sep 17 00:00:00 2001 From: arohanajit Date: Sat, 7 Sep 2024 20:58:27 -0400 Subject: [PATCH 2/2] fixed flake8 details .flake8 --- .flake8 | 1 - 1 file changed, 1 deletion(-) diff --git a/.flake8 b/.flake8 index 47fa3239a24..4b493d3927e 100644 --- a/.flake8 +++ b/.flake8 @@ -20,7 +20,6 @@ per-file-ignores = # F841 local variable assigned to but never used # E741 ambiguous variable name 'l' __init__.py: F401, F403 - lib/init/grass.py: E722, F821, F841 utils/gitlog2changelog.py: E722, E712 man/build_check_rest.py: F403, F405 man/build_full_index_rest.py: F403, F405