osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ci/+/39909?usp=email )
Change subject: *.py: ignore: E722 Do not use bare `except`
......................................................................
*.py: ignore: E722 Do not use bare `except`
Let the ruff linter not complain about the existing cases of "Do not use
bare `except`" so we get the linter to pass without changing the
existing logic here. With this we don't disable the check globally, so
we can consider making stricter excepts in new code.
Change-Id: Iaef20d47cd171aab23e516e7f7516caf98264249
---
M scripts/obs/lib/srcpkg.py
M scripts/verify_log_statements.py
2 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/09/39909/1
diff --git a/scripts/obs/lib/srcpkg.py b/scripts/obs/lib/srcpkg.py
index b5286d8..fc39563 100644
--- a/scripts/obs/lib/srcpkg.py
+++ b/scripts/obs/lib/srcpkg.py
@@ -57,7 +57,7 @@
print(f"{project}: getting version from debian/changelog")
version = lib.debian.get_last_version_from_changelog(project)
return f"{version}.{count}-{commit}"
- except:
+ except: # noqa: E722
print(f"{project}: using 0.0.0 as version")
return f"0.0.0.{count}-{commit}"
diff --git a/scripts/verify_log_statements.py b/scripts/verify_log_statements.py
index e0bcce6..a7b27d6 100755
--- a/scripts/verify_log_statements.py
+++ b/scripts/verify_log_statements.py
@@ -86,7 +86,7 @@
# that are not in quotes, between separate string constants.
try:
quoted = eval('(' + quoted + '\n)' )
- except:
+ except: # noqa: E722
# hopefully eval broke because of some '## args' macro def
if debug:
ignored.append(error_found(f, log.start(), 'Ignoring', log.group(0)))
@@ -115,7 +115,7 @@
r.line = line
return errors_found
- except:
+ except: # noqa: E722
print("ERROR WHILE PROCESSING %r" % f, file=sys.stderr)
raise
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ci/+/39909?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Iaef20d47cd171aab23e516e7f7516caf98264249
Gerrit-Change-Number: 39909
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>