Skip to content

Commit

Permalink
CI: Update .flake8 configuration and fix flake8 errors in lib/init/gr…
Browse files Browse the repository at this point in the history
…ass.py (#4289)

* fixed flake8 errors in lib/init/grass.py

* fixed flake8 details .flake8
  • Loading branch information
arohanajit committed Sep 12, 2024
1 parent 569c730 commit 5719ba6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -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
man/build_check_rest.py: F403, F405
man/build_full_index_rest.py: F403, F405
man/parser_standard_options.py: F403, F405
Expand Down
10 changes: 5 additions & 5 deletions lib/init/grass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -1571,7 +1571,7 @@ def say_hello():

revision = linerev.split(" ")[1]
sys.stderr.write(" (" + revision + ")")
except:
except Exception:
pass


Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5719ba6

Please sign in to comment.