Skip to content

Commit

Permalink
style: Fixes useless-exception-statement (PLW0133) (OSGeo#3957)
Browse files Browse the repository at this point in the history
Concerns Pylint rule "pointless-exception-statement / W0133"

Using `ruff check --output-format=concise --select PLW0133 --unsafe-fixes --fix`.
  • Loading branch information
echoix authored Jul 1, 2024
1 parent a9f81f4 commit 734c93d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/grass/grassdb/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def split_mapset_path(mapset_path):
"""Split mapset path to three parts - grassdb, location, mapset"""
mapset_path = Path(mapset_path)
if len(mapset_path.parts) < 3:
ValueError(
raise ValueError(
_("Mapset path '{}' needs at least three components").format(mapset_path)
)
mapset = mapset_path.name
Expand Down
2 changes: 1 addition & 1 deletion scripts/g.extension/testsuite/test_addons_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def setUp(self):
if self.install_prefix.exists():
files = list(path.name for path in self.install_prefix.iterdir())
if files:
RuntimeError(
raise RuntimeError(
f"Install prefix path '{self.install_prefix}' \
contains files {','.join(files)}"
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/g.extension/testsuite/test_addons_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def setUp(self):
if os.path.exists(self.install_prefix):
files = os.listdir(self.install_prefix)
if files:
RuntimeError(
raise RuntimeError(
"Install prefix path '{}' contains files {}".format(
self.install_prefix, files
)
Expand Down

0 comments on commit 734c93d

Please sign in to comment.