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

CI: Update .flake8 configuration and fix flake8 errors in lib/init/grass.py #4289

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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
Loading