Summary
For multi-line try blocks S110 only detects for Exception - other exception types (e.g. RuntimeError) stop it detecting.
See playground link for reproduction
Also relates to #8593 - where S110 is suggested for that case.
# Detected by S110
try:
i = 42
j = 24
except Exception:
pass
# Not detected by S110
try:
i = 42
j = 24
except RuntimeError:
pass
gives
$ ruff check --isolated --select S110 test.py
test.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception
|
1 | try:
2 | i = 42
3 | / except Exception:
4 | | pass
| |________^ S110
5 |
6 | try:
|
Found 1 error.
Version
ruff 0.11.5