osmith submitted this change.

View Change

Approvals: fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, approved laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified
testenv: fix blind except

Related: https://docs.astral.sh/ruff/rules/blind-except/
Change-Id: Ie39140b5bf1f80ac738578659a80d7e5f2422776
---
M .ruff.toml
M _testenv/testenv/testsrcdir_cfg.py
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/.ruff.toml b/.ruff.toml
index ff68e24..3266244 100644
--- a/.ruff.toml
+++ b/.ruff.toml
@@ -5,7 +5,6 @@

[lint]
ignore = [
- "BLE001", # https://docs.astral.sh/ruff/rules/blind-except/
"DTZ001", # https://docs.astral.sh/ruff/rules/call-datetime-without-tzinfo/
"DTZ004", # https://docs.astral.sh/ruff/rules/call-datetime-utcfromtimestamp/
"DTZ005", # https://docs.astral.sh/ruff/rules/call-datetime-now-without-tzinfo/
diff --git a/_testenv/testenv/testsrcdir_cfg.py b/_testenv/testenv/testsrcdir_cfg.py
index d72317f..c21c29c 100644
--- a/_testenv/testenv/testsrcdir_cfg.py
+++ b/_testenv/testenv/testsrcdir_cfg.py
@@ -34,7 +34,7 @@
if max_jobs < 1:
raise RuntimeError(f"max_jobs is invalid: max_jobs={max_jobs}, gb_ram={gb_ram}")

- except Exception as ex:
+ except (FileNotFoundError, ValueError, RuntimeError) as ex:
traceback.print_exception(type(ex), ex, ex.__traceback__)
logging.error(f"Calculating max jobs with max_jobs_per_gb_ram={max_jobs_per_gb_ram} failed, assuming 4")
max_jobs = 4

To view, visit change 43617. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie39140b5bf1f80ac738578659a80d7e5f2422776
Gerrit-Change-Number: 43617
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: jolly <andreas@eversberg.eu>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>