Summary
The fix for suppressible-exception (SIM105) can change the program’s behavior in Python 3.11 for except*. If some code uses except*, it’s probably because a BaseExceptionGroup can be raised. Because contextlib.suppress only gained support for BaseExceptionGroup in Python 3.12, the fix is most likely wrong for except* in Python 3.11. SIM105 should be suppressed in that case: not just the fix, but the whole rule, because there’s generally no way to simplify the code under these circumstances, so it’s not helpful for Ruff to flag it at all. Example:
$ cat >sim105.py <<'# EOF'
def raise_group(x):
raise ExceptionGroup("!", [ValueError(x)])
try:
raise_group(1)
except* ValueError:
pass
# EOF
$ python3.11 sim105.py; echo $?
0
$ ruff --isolated check --select SIM105 sim105.py --unsafe-fixes --fix --target-version py311
Found 1 error (1 fixed, 0 remaining).
$ cat sim105.py
import contextlib
def raise_group(x):
raise ExceptionGroup("!", [ValueError(x)])
with contextlib.suppress(ValueError):
raise_group(1)
$ python3.11 sim105.py 2>&1 | sed 's:/.*/::g'
+ Exception Group Traceback (most recent call last):
| File "sim105.py", line 5, in <module>
| raise_group(1)
| File "sim105.py", line 3, in raise_group
| raise ExceptionGroup("!", [ValueError(x)])
| ExceptionGroup: ! (1 sub-exception)
+-+---------------- 1 ----------------
| ValueError: 1
+------------------------------------
Version
ruff 0.15.5 (5e4a3d9 2026-03-05)
Summary
The fix for
suppressible-exception(SIM105) can change the program’s behavior in Python 3.11 forexcept*. If some code usesexcept*, it’s probably because aBaseExceptionGroupcan be raised. Becausecontextlib.suppressonly gained support forBaseExceptionGroupin Python 3.12, the fix is most likely wrong forexcept*in Python 3.11. SIM105 should be suppressed in that case: not just the fix, but the whole rule, because there’s generally no way to simplify the code under these circumstances, so it’s not helpful for Ruff to flag it at all. Example:Version
ruff 0.15.5 (5e4a3d9 2026-03-05)