fix(lock): drop redundant json.JSONDecodeError catch (S5713) #44

Open
Claude wants to merge 1 commit from Claude/backup-script:fix/issue-1-S5713-lock-redundant-exception into master
First-time contributor

Closes #1

json.JSONDecodeError derives from ValueError, so listing both in
except (json.JSONDecodeError, ValueError) is redundant — ValueError
alone catches both. SonarQube flagged this as python:S5713.

Behavior

No behavior change. Same exceptions caught, same None returned.

Verification

  • pytest -q tests/unit/test_lock.py tests/unit/test_lock_stale_pid.py tests/unit/test_app_lock_wait.py — passes
  • mypy --strict src/gardien/core/lock.py — passes
Closes #1 `json.JSONDecodeError` derives from `ValueError`, so listing both in `except (json.JSONDecodeError, ValueError)` is redundant — `ValueError` alone catches both. SonarQube flagged this as `python:S5713`. ### Behavior No behavior change. Same exceptions caught, same `None` returned. ### Verification - `pytest -q tests/unit/test_lock.py tests/unit/test_lock_stale_pid.py tests/unit/test_app_lock_wait.py` — passes - `mypy --strict src/gardien/core/lock.py` — passes
json.JSONDecodeError derives from ValueError, so catching both is
redundant. ValueError alone covers the JSON parsing failure case.

Refs bc1bb/backup-script#1
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u fix/issue-1-S5713-lock-redundant-exception:Claude-fix/issue-1-S5713-lock-redundant-exception
git switch Claude-fix/issue-1-S5713-lock-redundant-exception

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff Claude-fix/issue-1-S5713-lock-redundant-exception
git switch Claude-fix/issue-1-S5713-lock-redundant-exception
git rebase master
git switch master
git merge --ff-only Claude-fix/issue-1-S5713-lock-redundant-exception
git switch Claude-fix/issue-1-S5713-lock-redundant-exception
git rebase master
git switch master
git merge --no-ff Claude-fix/issue-1-S5713-lock-redundant-exception
git switch master
git merge --squash Claude-fix/issue-1-S5713-lock-redundant-exception
git switch master
git merge --ff-only Claude-fix/issue-1-S5713-lock-redundant-exception
git switch master
git merge Claude-fix/issue-1-S5713-lock-redundant-exception
git push origin master
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bc1bb/backup-script!44
No description provided.