---
source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs
---
SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass`
 --> SIM105_1.py:5:1
  |
4 |   # SIM105
5 | / try:
6 | |     math.sqrt(-1)
7 | | except ValueError:
8 | |     pass
  | |________^
  |
help: Replace `try`-`except`-`pass` with `with contextlib.suppress(ValueError): ...`
  |
2 | import math
3 + import contextlib
4 |
5 | # SIM105
  - try:
6 + with contextlib.suppress(ValueError):
7 |     math.sqrt(-1)
  - except ValueError:
  -     pass
  |
note: This is an unsafe fix and may change runtime behavior
